I need to append to the PATH environment variable on an Azure Devops pipeline. I have tried running a script to do it but it does not work:
- script: |
echo '##vso[task.setvariable variable=PATH]${PATH}:some/path/'
This fails to set the path and also results in subsequent scripts failing with the following:
##[error]Unable to locate executable file: 'bash'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
What do I need to do in order to set this?
There is a special logging command for this:
echo '##vso[task.prependpath]some\path'
See more info here.
Got it, it was a simple syntax error
echo '##vso[task.setvariable variable=path]$(PATH):/dir/to/whatever'
I'd used {} instead of ().
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