Created
February 20, 2020 08:22
-
-
Save denvercoder/93ed3feb00523037d3c43972ff9a59bc to your computer and use it in GitHub Desktop.
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
shorteners() { | |
cat ~/Code/src/github.com/denvercoder/shorten/_redirects | |
} | |
shorten() { | |
# Rough test for URL in the wrong place | |
[[ "$1" =~ ":" ]] && echo "Please use the format: shorten shortname <url>" && return; | |
# Jump into shortener URL | |
cd ~/Code/src/github.com/denvercoder/shorten | |
npm run shorten $2 $1 | |
# Return to previous folder | |
cd - | |
} | |
shorten_undo() { | |
# Undoes last commit | |
cd ~/Code/src/github.com/denvercoder/shorten | |
git reset --hard HEAD~1 --quiet | |
git push --force origin master --quiet | |
cd - | |
shorteners; | |
} | |
shorten_doctor() { | |
cd ~/Code/src/github.com/denvercoder/shorten | |
git reset --hard --quiet | |
cd - | |
echo "Reset shortener git status" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment