Ensure `git describe` only matches version tags
`git describe` will match the latest tags, regardless of what it looks like. We can make this a little safer by adding a `--match` flag to match tags that look like version tags. This allows the maintainers of this repo to more safely add other types of tags if they so wish, without causing people to install or upgrade to those versions.
parent
17a3272b8a
commit
87a3a4425d
|
@ -84,7 +84,7 @@ For manual install create a folder somewhere in your filesystem with the `nvm.sh
|
||||||
Or if you have `git` installed, then just clone it, and check out the latest version:
|
Or if you have `git` installed, then just clone it, and check out the latest version:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags origin`
|
git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" origin`
|
||||||
```
|
```
|
||||||
|
|
||||||
To activate nvm, you need to source it from your shell:
|
To activate nvm, you need to source it from your shell:
|
||||||
|
@ -106,7 +106,7 @@ export NVM_DIR="$HOME/.nvm"
|
||||||
For manual upgrade with `git`, change to the `$NVM_DIR`, pull down the latest changes, and check out the latest version:
|
For manual upgrade with `git`, change to the `$NVM_DIR`, pull down the latest changes, and check out the latest version:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd "$NVM_DIR" && git fetch origin && git checkout `git describe --abbrev=0 --tags origin`
|
cd "$NVM_DIR" && git fetch origin && git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" origin`
|
||||||
```
|
```
|
||||||
|
|
||||||
After upgrading, don't forget to activate the new version:
|
After upgrading, don't forget to activate the new version:
|
||||||
|
|
Loading…
Reference in New Issue