我從竹在Windows機器上使用下面的代碼克隆庫竹:bash腳本不工作在Mac竹子,但在Windows
cd ${bamboo.build.working.directory}
IF EXIST devops (
cd devops
git pull
) ELSE (
git clone https://myDevops:[email protected]/myInfo/devops
)
這將導致回購的成功克隆是我正在努力獲得。但現在我試圖在Mac上克隆回購,而不是Windows機器。我已經改變了猛砸,以便它沒有錯誤運行到這一點:
cd ${bamboo.build.working.directory}
if [exist devops]; then
cd devops
git pull
else
git clone clone https://myDevops:[email protected]/myInfo/devops
fi
但現在我在日誌中收到此消息:
[exist: command not found
而在Windows上,它會在顯示此日誌:
C:\bamboo-home\xml-data\build-dir\THE-BLD-KEY>IF EXIST devops (
cd devops
git pull
) ELSE (git clone https://myDevops:[email protected]/myInfo/devops)
我不知道爲什麼在Mac上找不到消息命令。我原來的代碼段相同,但由於語法錯誤,我將Mac改爲現在的版本。爲什麼它不能得到命令?
'['是bash命令:空白是'['和'exist'之間強制性的(前提是'exist'存在作爲命令)。 – mouviciel