Merge pull request #494 from belak/better-realpath

Use method built in to zsh to read symlinks
pull/22/head
Ben Hilburn 8 years ago committed by GitHub
commit 6d677f5770

@ -44,7 +44,7 @@ fi
# Resolve the installation path # Resolve the installation path
if [[ -L "$POWERLEVEL9K_INSTALLATION_PATH" ]]; then if [[ -L "$POWERLEVEL9K_INSTALLATION_PATH" ]]; then
# If this theme is sourced as a symlink, we need to locate the real URL # If this theme is sourced as a symlink, we need to locate the real URL
filename="$(realpath -P $POWERLEVEL9K_INSTALLATION_PATH 2>/dev/null || readlink -f $POWERLEVEL9K_INSTALLATION_PATH 2>/dev/null || perl -MCwd=abs_path -le 'print abs_path readlink(shift);' $POWERLEVEL9K_INSTALLATION_PATH 2>/dev/null)" filename="${POWERLEVEL9K_INSTALLATION_PATH:A}"
elif [[ -d "$POWERLEVEL9K_INSTALLATION_PATH" ]]; then elif [[ -d "$POWERLEVEL9K_INSTALLATION_PATH" ]]; then
# Directory # Directory
filename="${POWERLEVEL9K_INSTALLATION_PATH}/powerlevel9k.zsh-theme" filename="${POWERLEVEL9K_INSTALLATION_PATH}/powerlevel9k.zsh-theme"
@ -664,7 +664,7 @@ prompt_dir() {
break; break;
fi fi
done done
local packageName=$(jq '.name' ${pkgFile} 2> /dev/null \ local packageName=$(jq '.name' ${pkgFile} 2> /dev/null \
|| node -e 'console.log(require(process.argv[1]).name);' ${pkgFile} 2>/dev/null \ || node -e 'console.log(require(process.argv[1]).name);' ${pkgFile} 2>/dev/null \
|| cat "${pkgFile}" 2> /dev/null | grep -m 1 "\"name\"" | awk -F ':' '{print $2}' | awk -F '"' '{print $2}' 2>/dev/null \ || cat "${pkgFile}" 2> /dev/null | grep -m 1 "\"name\"" | awk -F ':' '{print $2}' | awk -F '"' '{print $2}' 2>/dev/null \

Loading…
Cancel
Save