File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 1
1
# ## Project ###
2
2
versions.txt
3
+ package.json
3
4
4
5
# ## Linux ###
5
6
* ~
Original file line number Diff line number Diff line change @@ -46,6 +46,12 @@ source "$HOME/.nvm/nvm.sh"
46
46
padding=10000
47
47
script_dir=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd)
48
48
version_dir=" $script_dir /versions.txt"
49
+
50
+ if [[ ! -e ' package.json' ]]; then
51
+ npm $@
52
+ exit 0
53
+ fi
54
+
49
55
engines=$( jq ' .engines.node' -r package.json)
50
56
51
57
# no configuration found dont switch version
@@ -54,6 +60,10 @@ if [ ! -n "$engines" ]; then
54
60
exit 0
55
61
fi
56
62
63
+ if [[ ! -e $version_dir ]]; then
64
+ NO_CACHE=1
65
+ fi
66
+
57
67
# get engine config from package.json
58
68
node_version=($( grep -Eo ' [0-9]+\.[0-9]+\.[0-9]+' <<< " $engines" ) )
59
69
You can’t perform that action at this time.
0 commit comments