[Fix] nvm_get_default_packages: use awk for more reliable file processing

See https://github.com/nvm-sh/nvm/commit/db19450caafb37734a3302b24ac9fe2cde40638d

Fixes #3382
This commit is contained in:
Jordan Harband
2024-07-28 10:02:08 -07:00
parent f439acda4a
commit 87a709741f
2 changed files with 17 additions and 31 deletions
@@ -74,7 +74,7 @@ rimraf
EOF
DEFAULT_PKGS="$(nvm_get_default_packages 2>&1 >/dev/null)"
EXPECTED_PKGS="Only one package per line is allowed in the $FILE file. Please remove any lines with multiple space-separated values."
EXPECTED_PKGS="Only one package per line is allowed in \`${FILE}\`. Please remove any lines with multiple space-separated values."
[ "${DEFAULT_PKGS}" = "${EXPECTED_PKGS}" ] || die "4: expected default packages >${EXPECTED_PKGS}<; got >${DEFAULT_PKGS}<"
cleanup