Skip to content

Commit

Permalink
Merge pull request #59 from jedahan/use-builtin-cd
Browse files Browse the repository at this point in the history
Use builtin cd, fixes #56, enhancd compatability
  • Loading branch information
supercrabtree committed Jan 22, 2016
2 parents 2fd558e + 268e264 commit ec2d812
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions k.sh
Original file line number Diff line number Diff line change
Expand Up @@ -285,16 +285,16 @@ k () {
GIT_TOPLEVEL=''
else
if (( IS_DIRECTORY ));
then cd -q $NAME 2>/dev/null || cd -q - >/dev/null && IS_GIT_REPO=0 #Say no if we don't have permissions there
else cd -q $NAME:a:h 2>/dev/null || cd -q - >/dev/null && IS_GIT_REPO=0
then builtin cd -q $NAME 2>/dev/null || builtin cd -q - >/dev/null && IS_GIT_REPO=0 #Say no if we don't have permissions there
else builtin cd -q $NAME:a:h 2>/dev/null || builtin cd -q - >/dev/null && IS_GIT_REPO=0
fi
if [[ $(command git rev-parse --is-inside-work-tree 2>/dev/null) == true ]]; then
IS_GIT_REPO=1
GIT_TOPLEVEL=$(command git rev-parse --show-toplevel)
else
IS_GIT_REPO=0
fi
cd -q - >/dev/null
builtin cd -q - >/dev/null
fi

# Get human readable output if necessary
Expand Down

0 comments on commit ec2d812

Please sign in to comment.