Commit Graph
1 Commits
Author SHA1 Message Date
Jay Hemnani c7a1b344da [Fix] install.sh: only write $HOME when $NVM_DIR is inside it
The profile line was built by replacing a leading `$HOME` with `sed`,
without a path boundary,
and with `$HOME` treated as a regex.
With `HOME=/home/me` and `NVM_DIR=/home/me2/nvm`,
or with `HOME=/` and `NVM_DIR=/usr/local/nvm`,
the profile got `export NVM_DIR="$HOME2/nvm"` or `export NVM_DIR="$HOMEusr/local/nvm"`,
which expand to the wrong directory,
so nvm does not load in new shells.
A `.` in `$HOME` matched any character,
a `:` in it broke the `sed` expression,
and a trailing slash on it left `$HOME.nvm`.

Match `$HOME` literally, as a whole path component,
and leave the path absolute when `$HOME` is empty.
2026-10-15 18:13:32 +05:30