如果有可用文件,则不预先推送此类文件

时间:2019-04-17 20:37:41

标签: git rspec githooks

  

致命:无法运行.git / hooks / pre-push:没有此类文件或目录

.git / hooks / pre-push中的预推文件

#!/bin/env bash
echo "Running RSpec"
bundle exec rspec spec
spec=$?

if [ $spec -eq 0 ]; then
  echo -en "\\033[32mTests are green, pushing...\\033[0;39m\n"
  exit 0
else
  echo -en "\\033[1;31mCannot push, tests are failing. Use --no-verify to force push.\\033[0;39m\n"
  exit 1
fi

我跑了。

chmod u+x .git/hooks/pre-push

并从此处获取代码:

https://gist.github.com/johnhamelink/577b8613ae82d2b3037b

0 个答案:

没有答案