【发布时间】:2021-10-25 16:38:29
【问题描述】:
我需要在 github workflow 中安装 Visual Studio Code 的扩展。我想在工作流中运行这个命令:
run: C:/Program Files/Microsoft VS Code/code.exe --install-extension ms-dynamics-smb.al
但是,github runner 不喜欢这样:
Run C:\Program Files\Microsoft VS Code\code.exe --install-extension ms-dynamics-smb.al
C:\Program: D:\a\_temp\e14dee42-ae33-48ac-ad4e-44f4e4600de5.ps1:2
Line |
2 | C:\Program Files\Microsoft VS Code\code.exe --install-extension ms-dy …
| ~~~~~~~~~~
| The term 'C:\Program' is not recognized as a name of a cmdlet, function, script file, or executable
| program. Check the spelling of the name, or if a path was included, verify that the path is correct
| and try again.
我尝试了以下变体,但一切都失败了:
run "C:\Program Files\Microsoft VS Code\code.exe --install-extension ms-dynamics-smb.al"
--> Invalid workflow file
run "C:/Program Files/Microsoft VS Code/code.exe --install-extension ms-dynamics-smb.al"
--> The term 'C:/Program' is not recognized as a name of a cmdlet...
run 'C:/Program Files/Microsoft VS Code/code.exe --install-extension ms-dynamics-smb.al'
--> The term 'C:/Program' is not recognized as a name of a cmdlet...
run \"C:/Program Files/Microsoft VS Code/code.exe\" --install-extension ms-dynamics-smb.al
--> The term '\C:/Program Files/Microsoft VS Code/code.exe\' is not recognized...
如何正确处理/转义 github 工作流文件中带有空格的路径?
【问题讨论】:
标签: windows yaml github-actions