mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-10 22:31:51 +00:00
fixed issue with correct overwriting symlink
This commit is contained in:
parent
e5a27992ff
commit
f3103487b0
5
nvm.sh
5
nvm.sh
@ -127,7 +127,10 @@ nvm_checksum() {
|
||||
nvm_update_symlink() {
|
||||
# execute only when a symlink is defined
|
||||
if [ -f $NVM_DIR/symlink ]; then
|
||||
ln -s $(echo $NVM_DIR/v`cat $NVM_DIR/alias/default`) $(echo `cat $NVM_DIR/symlink`)
|
||||
if [ -d `cat $NVM_DIR/symlink` ]; then
|
||||
rm `cat $NVM_DIR/symlink`
|
||||
fi
|
||||
ln -sf $(echo $NVM_DIR/`cat $NVM_DIR/alias/default`) $(echo `cat $NVM_DIR/symlink`)
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user