diff --git a/plugins/webhook/tpl/git.tpl b/plugins/webhook/tpl/git.tpl index 7a04d73be..26004bb91 100644 --- a/plugins/webhook/tpl/git.tpl +++ b/plugins/webhook/tpl/git.tpl @@ -13,7 +13,12 @@ if [ ! -d {$ROOT_PATH}/gitcode ];then fi if [ -d {$ROOT_PATH}/gitcode/{$REPO} ];then - cd {$ROOT_PATH}/gitcode/{$REPO} && sudo git pull + which sudo + if [ "$?" == "0" ];then + cd {$ROOT_PATH}/gitcode/{$REPO} && sudo git pull + else + cd {$ROOT_PATH}/gitcode/{$REPO} && git pull + fi else cd {$ROOT_PATH}/gitcode && git clone http://0.0.0.0:6660/xx/{$REPO} fi