re1ro / grunt-bg-shell

Better shell commands for grunt
MIT License
50 stars 8 forks source link

no grunt template vars resolving in string #20

Closed monsdroid closed 7 years ago

monsdroid commented 7 years ago

Hi,

thanks for the plugin! I switched from grunt-.shell-spawn, well, because of reasons. What i could do in grunt shell was using config properties in the string a command returned. basicaly that grunt template thingy

e.g.

command: function (exportConfigFile) {
            return ' \
                java -classpath <%= someVar %>/lib/* \
                -Dlogback.configurationFile=<%=exportConfigFile%>/logback.xml;
        }

in your plugin theses vars wont get resolved. instead i get java -classpath <%= someVar %>/lib/* ...

Best regards, Simon

re1ro commented 7 years ago

@monsdroid You have a full flexibility of what happens inside of your function. You could try it this way

command: function () {
            return grunt.template.process(' \
                java -classpath <%= someVar %>/lib/* \
                -Dlogback.configurationFile=<%=exportConfigFile%>/logback.xml');
        }