mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-08-16 18:43:43 +00:00
Compare commits
6 Commits
46d5126ec4
...
2fcf3030dc
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2fcf3030dc | ||
![]() |
74eb396099 | ||
![]() |
cf9beb7f86 | ||
![]() |
9222739d18 | ||
![]() |
9f520c97db | ||
![]() |
e5521cfd3c |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -19,6 +19,8 @@ jobs:
|
||||
raw.githubusercontent.com:443
|
||||
registry.npmjs.org:443
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-tags: true
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "14"
|
||||
|
6
nvm.sh
6
nvm.sh
@ -476,6 +476,12 @@ nvm_tree_contains_path() {
|
||||
previous_pathdir="${node_path}"
|
||||
local pathdir
|
||||
pathdir=$(dirname "${previous_pathdir}")
|
||||
|
||||
# get real directory in case of symbolic links
|
||||
if [ -d "${pathdir-}" ]; then
|
||||
pathdir="$(nvm_cd -P "${pathdir}" && pwd)"
|
||||
fi
|
||||
|
||||
while [ "${pathdir}" != '' ] && [ "${pathdir}" != '.' ] && [ "${pathdir}" != '/' ] &&
|
||||
[ "${pathdir}" != "${tree}" ] && [ "${pathdir}" != "${previous_pathdir}" ]; do
|
||||
previous_pathdir="${pathdir}"
|
||||
|
@ -45,7 +45,7 @@
|
||||
"dockerfile_lint": "^0.3.4",
|
||||
"doctoc": "^2.2.1",
|
||||
"eclint": "^2.8.1",
|
||||
"markdown-link-check": "^3.12.2",
|
||||
"markdown-link-check": "^3.13.6",
|
||||
"replace": "^1.2.2",
|
||||
"semver": "^7.6.3",
|
||||
"urchin": "^0.0.5"
|
||||
|
@ -1,6 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
cleanup () {
|
||||
rm tmp3/tmp2
|
||||
rmdir tmp3
|
||||
rm tmp/node
|
||||
rmdir tmp
|
||||
rm tmp2/node
|
||||
@ -14,6 +16,8 @@ mkdir -p tmp
|
||||
touch tmp/node
|
||||
mkdir -p tmp2
|
||||
touch tmp2/node
|
||||
mkdir -p tmp3
|
||||
ln -s tmp2 tmp3/
|
||||
|
||||
[ "$(nvm_tree_contains_path 2>&1)" = "both the tree and the node path are required" ] || die 'incorrect error message with no args'
|
||||
[ "$(nvm_tree_contains_path > /dev/null 2>&1 ; echo $?)" = "2" ] || die 'incorrect error code with no args'
|
||||
@ -28,4 +32,6 @@ nvm_tree_contains_path tmp2 tmp2/node || die '"tmp2" should contain "tmp2/node"'
|
||||
|
||||
nvm_tree_contains_path tmp2 tmp/node && die '"tmp2" should not contain "tmp/node"'
|
||||
|
||||
nvm_tree_contains_path tmp2 tmp3 && die 'no idea'
|
||||
|
||||
cleanup
|
||||
|
28
test/slow/nvm run/Running 'nvm run --silent' should work
Executable file
28
test/slow/nvm run/Running 'nvm run --silent' should work
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
die () { echo "$@" ; exit 1; }
|
||||
|
||||
. ../../../nvm.sh
|
||||
|
||||
echo "0.10.7" > .nvmrc
|
||||
|
||||
# Check nvm run without --silent
|
||||
OUTPUT="$(nvm run --version)"
|
||||
EXPECTED_OUTPUT="Found '${PWD}/.nvmrc' with version <0.10.7>
|
||||
Running node v0.10.7 (npm v1.2.21)
|
||||
v0.10.7"
|
||||
[ ">${OUTPUT}<" = ">${EXPECTED_OUTPUT}<" ] \
|
||||
|| die "\`nvm run\` failed to run; did not match with the .nvmrc version; got >${OUTPUT}<"
|
||||
|
||||
OUTPUT="$(nvm run --silent --version)"
|
||||
EXPECTED_OUTPUT="v0.10.7"
|
||||
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] \
|
||||
|| die "\`nvm run --silent\` failed to run silently; expected no output, got >${OUTPUT}<"
|
||||
|
||||
# Output shouldn't be silent if --silent flag is not at the third argument position
|
||||
OUTPUT="$(nvm run --version --silent)"
|
||||
EXPECTED_OUTPUT=""
|
||||
[ "${OUTPUT}" != "${EXPECTED_OUTPUT}" ] \
|
||||
|| die "\`nvm run --version --silent\` should not be silent; expected >${OUTPUT}<, got no output"
|
Loading…
x
Reference in New Issue
Block a user