Skip to content
Myr

Make sure the new `versions` directory is filtered out of nvm_ls output (in zsh).

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jordan Harband · committed by Jordan Harband · parent 7551746 · Browse files · 2 files+15 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+15 added−1 removed

  • tests:+14 added−0 removed
  • other:+1 added−1 removed

2 files+15 added−1 removed

added:test/fast/Listing versions/Running "nvm ls" should filter out "versions"+14 added
1#!/bin/sh23mkdir ../../../v0.1.34mkdir ../../../v0.2.356. ../../../nvm.sh78mkdir ../../../versions910[ -z "$(nvm ls | \grep 'versions')" ]11# The result should contain only the appropriate version numbers.1213rmdir ../../../versions14
modified:nvm.sh+1 added-1 removed
229 unmodified lines
230 PATTERN="$PATTERN."231 fi232 if [ -d "$(nvm_version_dir new)" ]; then233 VERSIONS=`find "$(nvm_version_dir new)/" "$(nvm_version_dir old)/" -maxdepth 1 -type d -name "$PATTERN*" -exec basename '{}' ';' \234 | sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | \grep -v '^ *\.' | \grep -e '^v'`234 | sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | \grep -v '^ *\.' | \grep -e '^v' | \grep -v -e '^versions$'`235 else236 VERSIONS=`find "$(nvm_version_dir old)/" -maxdepth 1 -type d -name "$PATTERN*" -exec basename '{}' ';' \237 | sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | \grep -v '^ *\.' | \grep -e '^v'`238 fi
567 unmodified lines