Wildcards (as used in ‘’/tmp-’’) are a bash feature. If you want to use bash features, you need to call the ‘bash’ executable, and tell it to run the ‘aws’ command.
There is no wildcard expansion done by bash – the bash command line argument is enclosed in " It’s the invoked executable (aws) that uses the --exclude argument.
The Exec task appears to be taking the absolute srcPath argument and making it relative. The relative path supplied to the executable (aws) causes the match pattern to miss.
How do I get Exec not to automagically relativize my srcPath?
If you println srcPath inside the configuration block for your Exec task, is it absolute then?
I don’t see anything special in the Exec code that would know how to make paths relative in the arguments. It looks like it just calls toString on all of the arguments.