2014-12-02 82 views
0

当我有以下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-堆栈生成此代码: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) 

问题是什么?我该如何解决它?

+0

您允许修改脚本吗? – helloV 2014-12-02 23:44:41

回答

0

我不确定脚本是如何生成的,但似乎有一些不必要的转义。我清理它,下面的作品适合我:

export GIT_RECURSIVE=$([ ! "`git --version`" \< "git version 1.6.5" ] && echo --recursive) &&