Last active
May 26, 2017 06:14
-
-
Save Illizian/2da4bb70288956d153da3e84f3292ca4 to your computer and use it in GitHub Desktop.
A QoL ZSH/Bash script for Trezor related git activities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git() { | |
if command git rev-parse --git-dir > /dev/null 2>&1; then | |
# We're in a Git Repo | |
identity=$(command git config remote.origin.url | egrep -o '[a-z]+@[a-z]+.[a-z]+') | |
case "$1" in | |
commit) | |
command trezor-gpg unlock | |
command git $@ | |
;; | |
clone|push|pull) | |
command trezor-agent $identity -- git $@ | |
;; | |
*) | |
command git $@ | |
esac | |
else | |
command git $@ | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment