Hook change directories commands to execute script on enter and on leave