aloverso
2/28/2020 - 7:42 PM

check for tests before pushing

check for tests before pushing

git() { 
  if [ "$1" = "push" ]
  then 
    read -r -p "Did you run the build before pushing? [y/N] " response
    if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]
    then
        command git "$@"
    else
        echo "go run the build first!"
    fi
  else
    command git "$@"
  fi
 }