Skip to content

Commit

Permalink
Use built-in Change Directory(cd) command (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
carloseduardosx authored and carolynvs committed Oct 17, 2017
1 parent 840e0f2 commit 9d9a4c1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ fi
if [ -n "$BASH_SOURCE" ]; then
DVM_SCRIPT_SOURCE="${BASH_SOURCE[0]}"
fi
export DVM_HELPER="$(command cd $DVM_CD_FLAGS "$(dirname "${DVM_SCRIPT_SOURCE:-$0}")" > /dev/null && command pwd)/dvm-helper/dvm-helper"
if command -v builtin >/dev/null 2>&1; then
export DVM_HELPER="$(builtin cd $DVM_CD_FLAGS "$(dirname "${DVM_SCRIPT_SOURCE:-$0}")" > /dev/null && command pwd)/dvm-helper/dvm-helper"
else
export DVM_HELPER="$(cd $DVM_CD_FLAGS "$(dirname "${DVM_SCRIPT_SOURCE:-$0}")" > /dev/null && command pwd)/dvm-helper/dvm-helper"
fi
unset DVM_SCRIPT_SOURCE 2> /dev/null

dvm() {
Expand Down

0 comments on commit 9d9a4c1

Please sign in to comment.