尽管添加到路径中,Jenkins 仍无法识别 sh.exe

Gas*_*ton 6 windows jenkins jenkins-plugins

sh我正在尝试使用而不是在 Windows 上运行管道bat

我在全局属性中添加了以下路径:

C:\Program Files\Git\usr\bin
C:\Program Files\Git\bin 
Run Code Online (Sandbox Code Playgroud)

但它仍然不起作用。

当我运行管道时,我收到以下错误消息:

[pipeline] sh
/usr/bin/sh: C:\Program Files\Git\bin\sh.exe: Command not found
[pipeline] }
Run Code Online (Sandbox Code Playgroud)

请注意,该文件sh.exe位于文件夹中C:\Program Files\Git\bin\

但是,如果我将 Freestyle 项目与 一起使用Execute Shell,它就会正常工作。

我还能做什么来解决这个问题?

Gas*_*ton 2

事实证明,Program Files在尝试运行管道时,其中的空间是导致问题的原因。因此sh.exe在 中没有找到C:\Program Files\Git\bin\

所以我不得不将Git\bin位置移动到路径中没有空格的其他地方。