我有以下capistrano脚本(为简单起见,请重新缩进):
sh -c
'git clone -q [email protected]:naorye/WebDevEasy-Wordpress.git /home1/webdevea/public_html/staging/shared/cached-copy &&
cd /home1/webdevea/public_html/staging/shared/cached-copy &&
git checkout -q -b deploy e508df390778be1d6ce4c4f7ceb71db149fa8f77 &&
git submodule -q init &&
git submodule -q sync &&
export GIT_RECURSIVE=$([ ! \"`git --version`\" \\< \"git version 1.6.5\" ] && echo --recursive) &&
git submodule -q update --init $GIT_RECURSIVE;'
WP-stack生成的以下代码:https : //github.com/markjaquith/WP-Stack
在远程计算机上运行此代码时,出现错误:
-bash: "git: No such file or directory
调试时(一行一行地运行),我看到导致错误的行是:
export GIT_RECURSIVE=$([ ! \"`git --version`\" \\< \"git version 1.6.5\" ] && echo --recursive)
问题是什么?我该如何解决?
我不确定该脚本是如何生成的,但是似乎有一些不必要的转义。我清理了一下,并为我做了以下工作:
export GIT_RECURSIVE=$([ ! "`git --version`" \< "git version 1.6.5" ] && echo --recursive) &&
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句