nvm-sh-nvm/test
Jordan Harband 26066c10f4
[Fix] prevent sed errors when pattern contains #
When `.nvmrc` or alias files contained comments (lines with `#`),
the `#` character could end up in the search pattern passed to sed,
causing "unterminated regular expression" errors because `#` is
used as the sed address delimiter.

This commit fixes the issue in two places:
1. `nvm_alias`: Strip comments from alias file contents before
   returning them, and trim trailing whitespace
2. `nvm_ls`: Escape `#` characters in SEARCH_PATTERN so they're
   treated as literal characters in the sed address

Fixes #3761
2026-01-19 22:58:43 -08:00
..
fast [Fix] prevent sed errors when pattern contains # 2026-01-19 22:58:43 -08:00
fixtures [New] allow .nvmrc files to support comments 2024-06-07 10:13:00 -07:00
install_script [Tests] nvm_detect_profile: refactor 2024-11-12 13:31:36 -08:00
installation_iojs [Tests] fix broken tests exposed by 863bd63 2024-08-27 12:46:40 -07:00
installation_node [Fix] nvm ls, nvm alias, nvm install: error when an LTS name is invalid 2024-09-04 13:55:11 -07:00
mocks [Fix] fix node download link for armv8l 2023-04-29 16:41:31 -07:00
slow [Fix] reinstall-packages: do not reinstall corepack 2025-03-11 13:16:58 -07:00
sourcing [Tests] move sourcing suite to GHA 2024-08-22 13:30:55 -07:00
xenial [Tests] move tests that fail on focal to a separate suite that runs on xenial 2022-12-22 11:26:27 -08:00
common.sh [Tests] use a better JSON parsing implementation 2024-06-10 11:33:12 -07:00