Skip to content

Instantly share code, notes, and snippets.

@BryanMoslo
Created June 16, 2020 20:27
Show Gist options
  • Save BryanMoslo/98f32a1d1976f65b4e388c3866674f17 to your computer and use it in GitHub Desktop.
Save BryanMoslo/98f32a1d1976f65b4e388c3866674f17 to your computer and use it in GitHub Desktop.
This bash funtion checks if buffy tests, go linter and js tests pass before push the current branch
push(){
if ! buffalo test ./... ; then
echo "Dude, your tests are failing, I can not push this branch"
return
fi
if ! golangci-lint run -v ; then
echo "Dude, your golangci linter is failing, I can not push this branch"
return
fi
if ! yarn run jest assets/js/*.test.js ; then
echo "Dude, your javascript tests are failing, I can not push this branch"
return
fi
git push origin HEAD
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment