Skip to content
Myr

Create nvm_version_path

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 6baa9a0 · Browse files · 2 files+19 added−0 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+19 added−0 removed

  • tests:+9 added−0 removed
  • other:+10 added−0 removed

2 files+19 added−0 removed

added:test/fast/Unit tests/nvm_version_path+9 added
1#!/bin/sh23die () { echo $@ ; exit 1; }45. ../../../nvm.sh67[ "$(nvm_version_path)" = "$NVM_DIR" ] &&8[ "$(nvm_version_path foo)" = "$NVM_DIR/foo" ]9
modified:nvm.sh+10 added
93 unmodified lines
94 echo "Found '$NVMRC_PATH' with version <$NVM_RC_VERSION>"95 fi96}9798nvm_version_path() {99 local VERSION100 VERSION="$1"101 if [ -z "$VERSION" ]; then102 echo "$NVM_DIR"103 elif [ ! -z "$VERSION" ]; then104 echo "$NVM_DIR/$VERSION"105 fi106}107108# Expand a version using the version cache109nvm_version() {110 local PATTERN111 PATTERN=$1
659 unmodified lines