mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-11-25 18:23:46 +03:00
`nvm_ls_remote_index_tab` compared the codename with awk's `!~`, so the name was a regex: `--lts=.` matched every LTS line, and `--lts=i.on` or `--lts=(` didn't mean what they say. Use `index()` so a name still matches every codename that contains it, but literally, and do the same in `nvm_filter_lts_versions`, for `--lts=<name>` in an alias. Locally, `--lts=<name>` resolved the `lts/<name>` alias, which only exists for full codenames, so `nvm use --lts=ir` failed where `nvm install --lts=ir` installed Iron. Add `nvm_resolve_lts_name`, which picks the newest codename in `$NVM_DIR/.lts-status` that contains the name, and resolve `lts/<codename>` with it in `nvm use`, `uninstall`, `exec`, `run`, and in `nvm install` for its offline lookup and the default and `--alias=` it writes. Without a recorded status, or when no codename contains the name, the name is used as given. Signed-off-by: Divya Chukkapalli <12871391+divya0795@users.noreply.github.com> Co-authored-by: Divya Chukkapalli <12871391+divya0795@users.noreply.github.com> Co-authored-by: Jordan Harband <ljharb@gmail.com>