如何修复bash中的git附件函数?

时间:2015-11-23 11:39:52

标签: git bash function

function checkGitAnnex
{
  echo "GIT ANNEX INFO:"
  echo "`git annex version`" 

  annex_init=echo `cd $GIT_REPO git annex init`
  if [[ $annex_init != *"ok"* ]]; then
      echo "ERROR with git annex init!"
      echo $annex_init
      echo -e "\t- Error with git annex init." >> err_message.txt
  else
      echo "init ok!"
  fi
}

但是这次执行给了我一个空值$ annex_init

P.S。正常执行命令:git annex is:

user@server156:~/some_project$ git annex init
init  
pre-commit hook (../../some_project/.git/hooks/pre-commit) already exists, not configuring
ok

0 个答案:

没有答案