Sir*_*her 10 continuous-integration azure-devops azure-pipelines-build-task
我需要附加到 Azure Devops 管道上的 PATH 环境变量。我尝试运行一个脚本来执行此操作,但它不起作用:
- script: |
echo '##vso[task.setvariable variable=PATH]${PATH}:some/path/'
Run Code Online (Sandbox Code Playgroud)
这无法设置路径,并且还会导致后续脚本失败,并显示以下内容:
##[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.
Run Code Online (Sandbox Code Playgroud)
我需要做什么才能设置这个?
Sha*_*zyk 19
为此有一个特殊的日志命令:
echo '##vso[task.prependpath]some\path'
Run Code Online (Sandbox Code Playgroud)
请在此处查看更多信息。
Sir*_*her 15
明白了,这是一个简单的语法错误
echo '##vso[task.setvariable variable=path]$(PATH):/dir/to/whatever'
Run Code Online (Sandbox Code Playgroud)
我使用了 {} 而不是 ()。
| 归档时间: |
|
| 查看次数: |
9811 次 |
| 最近记录: |