【问题标题】:Azure Devops run bash script can't find file pathAzure Devops 运行 bash 脚本找不到文件路径
【发布时间】:2021-03-15 22:29:19
【问题描述】:

所以我尝试在 Azure Devops 上的管道中运行 bash 脚本。这是我的代码:

- task: Bash@3
  inputs:
    filePath: '../marvel-lcg-companion/hooks/az-emulator'

但是正如你所见,我在运行管道时收到了这个错误。

##[error]ENOENT: no such file or directory, stat '/Users/runner/work/1/marvel-lcg-companion/hooks/az-emulator'

所以对我来说,不清楚如何格式化我的 YAML 文件中的文件路径。你们能指出我正确的方向吗?我也试过glob版本,没有成功

**/hooks/az-emulator

更新:我的根文件夹是 ma​​rvel-lcg-companion

【问题讨论】:

  • 那么文件的完整路径是什么?
  • 只有marvel的那个(也就是git的根目录)

标签: android bash azure-devops yaml azure-pipelines


【解决方案1】:

首先请通过添加以下内容来确保您的工作目录中有什么:

- script: ls '$(System.DefaultWorkingDirectory)'

但如果marvel-lcg-companion 是您的仓库根目录中的文件夹(并且您使用 sinfle 仓库),您应该尝试:

- task: Bash@3
  inputs:
    filePath: '$(System.DefaultWorkingDirectory)/marvel-lcg-companion/hooks/az-emulator'

但是,如果 marvel-lcg-companion 是您的 repo 的名称而不是这个:

- task: Bash@3
  inputs:
    filePath: '$(System.DefaultWorkingDirectory)/hooks/az-emulator'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-02-18
    • 2022-12-01
    • 2020-06-20
    • 1970-01-01
    • 2021-01-20
    • 2021-04-14
    • 1970-01-01
    相关资源
    最近更新 更多