mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-09-27 12:01:34 +00:00
[Fix] default_packages
: work when the file lacks a trailing newline
Fixes #1995.
This commit is contained in:
@@ -30,8 +30,11 @@ object-inspect@1.0.2
|
||||
# commented-package
|
||||
|
||||
stevemao/left-pad
|
||||
daytime
|
||||
EOF
|
||||
|
||||
printf %s "$(cat "${FILE}")" > $FILE # strip trailing newline
|
||||
|
||||
nvm install v6.10.1 2>&1
|
||||
EXIT_CODE=$?
|
||||
[ "_$EXIT_CODE" = "_0" ] || die "expected 'nvm install v6.10.1' to exit with 0, got $EXIT_CODE"
|
||||
@@ -41,6 +44,11 @@ if [ -z "$?" ]; then
|
||||
die "expected 'nvm exec v6.10.1 npm ls -g --depth=0 | grep -q 'rimraf'' to exit with 0, got $?"
|
||||
fi
|
||||
|
||||
nvm exec v6.10.1 npm ls -g --depth=0 | grep -q 'daytime'
|
||||
if [ -z "$?" ]; then
|
||||
die "expected 'nvm exec v6.10.1 npm ls -g --depth=0 | grep -q 'daytime'' to exit with 0, got $?"
|
||||
fi
|
||||
|
||||
cleanup
|
||||
|
||||
setup
|
||||
|
Reference in New Issue
Block a user