I'm building a gradle Exec task that implies just invoking a basic sed command, let says:  sed -i 's:some:substitution:' * 
What is the proper syntax or gradle function/variable to make the * glob replaced by the file it would match in some bash/zsh shell?
In other words, how to trigger shell expansion?
What I tried so far is :
task myTask(type: Exec){
    workingDirsome dir
    commandLine 'sed', '-i', 's:some:substitution:', "*"
}
but I get an error: sed: can't read *: No such file or directory , which is not so surprising.
You need to start the command wrapped in a shell:
commandLine 'bash', '-c', 'sed -i "s:some:substitution:" *'
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With