[Fix] nvm debug: Fix sed syntax error in nvm_command_info()

This commit is contained in:
Peter Dave Hello
2018-04-17 18:09:47 +08:00
committed by Jordan Harband
parent d3a9272a0c
commit d5dacdf80f
2 changed files with 9 additions and 1 deletions

2
nvm.sh
View File

@@ -48,7 +48,7 @@ nvm_command_info() {
local INFO
COMMAND="${1}"
if type "${COMMAND}" | nvm_grep -q hashed; then
INFO="$(type "${COMMAND}" | command sed -E 's/\(|)//g' | command awk '{print $4}')"
INFO="$(type "${COMMAND}" | command sed -E 's/\(|\)//g' | command awk '{print $4}')"
elif type "${COMMAND}" | nvm_grep -q aliased; then
INFO="$(which "${COMMAND}") ($(type "${COMMAND}" | command awk '{ $1=$2=$3=$4="" ;print }' | command sed -e 's/^\ *//g' -Ee "s/\`|'//g" ))"
elif type "${COMMAND}" | nvm_grep -q "^${COMMAND} is an alias for"; then