Skip to content

Instantly share code, notes, and snippets.

@sroccaserra
Last active September 7, 2020 13:10
Show Gist options
  • Select an option

  • Save sroccaserra/3cfa309f16d1ee20081af3804421f739 to your computer and use it in GitHub Desktop.

Select an option

Save sroccaserra/3cfa309f16d1ee20081af3804421f739 to your computer and use it in GitHub Desktop.
Test and commit or revert (TCR)
#!/usr/bin/env bash
T() {
npm t
}
C() {
git commit -am green
echo 'Commit :)'
}
R() {
git reset --hard
echo 'Revert!'
}
if T ; then C ; else R ; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment