From 1ece0b478975ed17dd6404e3f9f3dc04aa2d4b8b Mon Sep 17 00:00:00 2001 From: Artem Sapegin Date: Thu, 1 Nov 2012 15:25:40 +0400 Subject: [PATCH] Bash: add path printer, fix Git root. --- includes/bash_aliases.bash | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/bash_aliases.bash b/includes/bash_aliases.bash index 63bac03..95c505b 100644 --- a/includes/bash_aliases.bash +++ b/includes/bash_aliases.bash @@ -74,8 +74,11 @@ alias dos2unix="perl -pi -e 's/\r\n?/\n/g'" # Password generator password() { openssl rand -base64 ${1:-8} | c; } +# Show $PATH in a readable way +alias path='echo $PATH | sed "s/:/\n/g"' + # Git root -alias gr="[ ! -z `git rev-parse --show-cdup` ] && cd `git rev-parse --show-cdup || pwd`" +alias gr='git rev-parse 2>/dev/null && cd "./$(git rev-parse --show-cdup)"' # NPM alias npm-patch='npm version patch -m "%s"'