【问题标题】:Append to PATH on Azure Devops?在 Azure Devops 上附加到 PATH?
【发布时间】:2019-07-29 15:51:37
【问题描述】:

我需要附加到 Azure Devops 管道上的 PATH 环境变量。我曾尝试运行脚本来执行此操作,但它不起作用:

- script: |
echo '##vso[task.setvariable variable=PATH]${PATH}:some/path/'

这无法设置路径,并且还会导致后续脚本失败,并显示以下内容:

##[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.

我需要做什么才能设置它?

【问题讨论】:

    标签: azure-devops continuous-integration azure-pipelines-build-task


    【解决方案1】:

    为此有一个特殊的日志记录命令:

    echo '##vso[task.prependpath]some\path'
    

    查看更多信息here

    【讨论】:

      【解决方案2】:

      知道了,这是一个简单的语法错误

      echo '##vso[task.setvariable variable=path]$(PATH):/dir/to/whatever'
      

      我使用 {} 而不是 ()。

      【讨论】:

      • 这是一个可怕的错误信息,显示出这种情况
      猜你喜欢
      • 1970-01-01
      • 2020-09-13
      • 1970-01-01
      • 2011-01-24
      • 2020-05-25
      • 1970-01-01
      • 2020-03-30
      • 2021-06-27
      • 1970-01-01
      相关资源
      最近更新 更多