From e345e74360d1db74dc9ff5a2e707ccddc648826d Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Sun, 23 Dec 2018 21:40:14 +0100 Subject: [PATCH] Add .bashcd and .bashcdout hooks to cd --- bashrc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bashrc b/bashrc index fc42d6f..68fd409 100644 --- a/bashrc +++ b/bashrc @@ -114,3 +114,15 @@ PS1c='\[\033[00;34m\]┌─╼ \[\033[00;33m\]\$ \[\033[01;35m\]\u`git__prompt` \[\033[00;34m\]└╼ \[\033[00m\]' PS1=$PS1n + +cd() { + if [ -f .bashcdout ] + then + source .bashcdout + fi + builtin cd "$@" || return + if [ -f .bashcd ] + then + source .bashcd + fi +}