Skip to content

Commit

Permalink
Merge branch 'master' into major-vee
Browse files Browse the repository at this point in the history
* master:
  1.1.2
  Completion stops additional completions for --list
  shellcheck fix
  Completion stops suggesting non-links as aliases
  Refactors symlink listings
  --list drops the './' prefix from alias names
  • Loading branch information
jasonkarns committed May 28, 2017
2 parents edbedb8 + 0d9140e commit 98add17
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
22 changes: 10 additions & 12 deletions bin/nodenv-alias
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ SEMVER_SORT="$(get_script_dir)/../node_modules/sh-semver/semver.sh"

list() {
local exit=1
local dir
for dir in $(echo_lines ./*); do
if [ -L "$dir" ]; then
echo "$dir => $(resolve_link "$dir")"
exit=0
fi
local link
for link in $(echo_lines_with_symlinks ./*); do
echo "$link => $(resolve_link "$link")"
exit=0
done
return $exit
}
Expand All @@ -67,10 +65,10 @@ cleanup_invalid() {
done
}

echo_lines() {
local line
for line in "$@"; do
echo "$line"
echo_lines_with_symlinks() {
local file
for file in "$@"; do
[ -L "$file" ] && echo "${file#\./}"
done
}

Expand Down Expand Up @@ -132,14 +130,14 @@ abort() {
# Provide nodenv completions
if [ --complete = "$1" ]; then
shift
if [ "$#" = 1 ]; then
if [ "$#" = 1 ] && [ "$1" != --list ]; then
echo --auto
echo --remove
nodenv-versions --bare
elif [ "$#" = 0 ]; then
echo --auto
echo --list
{ recommended_aliases; nodenv-versions --bare; } | sort -u
{ recommended_aliases; echo_lines_with_symlinks ./*; } | sort -u
fi
exit 0
fi
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nodenv-aliases",
"version": "1.1.1",
"version": "1.1.2",
"private": true,
"description": "Create aliases for nodenv Node versions",
"homepage": "https://github.com/nodenv/nodenv-aliases#readme",
Expand Down

0 comments on commit 98add17

Please sign in to comment.