nodeswitch 1.9.4 → 1.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 alexsch01
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 alexsch01
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,48 +1,50 @@
1
- # nodeswitch
2
-
3
- Node version switcher for Microsoft Windows x64
4
-
5
- https://github.com/alexsch01/nodeswitch
6
-
7
- <br>
8
-
9
- #### How To Install
10
-
11
- ```
12
- npm install -g nodeswitch
13
-
14
- *****
15
- Node versions installed by this tool are in the "C:\Users\YOUR_USERNAME\AppData\Roaming\nodeswitch" folder
16
- *****
17
- ```
18
-
19
- #### Examples
20
-
21
- ```
22
- nodeswitch add 12.16.3
23
- nodeswitch add 18.13.0
24
-
25
- nodeswitch remove 12.16.3
26
- nodeswitch remove 18.13.0
27
-
28
- nodeswitch use 12.16.3
29
- nodeswitch use 18.13.0
30
-
31
- nodeswitch use default
32
-
33
- nodeswitch list
34
-
35
- nodeswitch path
36
- nodeswitch pathopen
37
- ```
38
-
39
- #### How To Uninstall
40
-
41
- ```
42
- npm uninstall -g nodeswitch
43
-
44
- *****
45
- In the "C:\Users\YOUR_USERNAME\AppData\Roaming\npm" folder, delete 4 files: nodeswitch, nodeswitch.cmd, nodeswitch.ps1, and nodeswitch.sh
46
- In the "C:\Users\YOUR_USERNAME\.bash_profile" file, remove the line [alias nodeswitch="source nodeswitch"]
47
- *****
48
- ```
1
+ # nodeswitch
2
+
3
+ Node version switcher for Microsoft Windows x64
4
+
5
+ https://github.com/alexsch01/nodeswitch
6
+
7
+ #### Linux Version
8
+
9
+ https://github.com/alexsch01/nodeswitch-linux
10
+
11
+ <br>
12
+
13
+ #### How To Install
14
+
15
+ ```
16
+ npm install -g nodeswitch
17
+
18
+ *****
19
+ Node versions installed by this tool are in the "C:\Users\YOUR_USERNAME\AppData\Roaming\nodeswitch" folder
20
+ *****
21
+ ```
22
+
23
+ #### Examples
24
+
25
+ ```
26
+ nodeswitch add 12.16.3
27
+ nodeswitch add 18.13.0
28
+
29
+ nodeswitch remove 12.16.3
30
+ nodeswitch remove 18.13.0
31
+
32
+ nodeswitch use 12.16.3
33
+ nodeswitch use 18.13.0
34
+
35
+ nodeswitch use default
36
+
37
+ nodeswitch list
38
+ nodeswitch path
39
+ ```
40
+
41
+ #### How To Uninstall
42
+
43
+ ```
44
+ npm uninstall -g nodeswitch
45
+
46
+ *****
47
+ In the "C:\Users\YOUR_USERNAME\AppData\Roaming\npm" folder, delete 4 files: nodeswitch, nodeswitch.cmd, nodeswitch.ps1, and nodeswitch.sh
48
+ In the "C:\Users\YOUR_USERNAME\.bash_profile" file, remove the line [alias nodeswitch="source nodeswitch"]
49
+ *****
50
+ ```
package/bin/nodeswitch CHANGED
@@ -1 +1 @@
1
- (return 0 2>/dev/null) && source nodeswitch.sh "$@" || echo "You need to relaunch Git Bash in order to use nodeswitch"
1
+ (return 0 2>/dev/null) && source nodeswitch.sh "$@" || echo "You need to relaunch Git Bash in order to use nodeswitch"
@@ -61,8 +61,6 @@ if not "%1" == "" (
61
61
  dir /b %AppData%\nodeswitch
62
62
  ) else if "%1" == "path" (
63
63
  echo %AppData%\nodeswitch
64
- ) else if "%1" == "pathopen" (
65
- powershell explorer "$(nodeswitch path)"
66
64
  ) else (
67
65
  echo Incorrect command
68
66
  )
@@ -67,8 +67,6 @@ if ( $nodeswitch1stParameter -ne $null ) {
67
67
  dir -n $env:AppData\nodeswitch
68
68
  } elseif ( $nodeswitch1stParameter -eq "path" ) {
69
69
  echo "$env:AppData\nodeswitch"
70
- } elseif ( $nodeswitch1stParameter -eq "pathopen" ) {
71
- explorer $(nodeswitch path)
72
70
  } else {
73
71
  echo "Incorrect command"
74
72
  }
package/bin/nodeswitch.sh CHANGED
@@ -1,69 +1,56 @@
1
- if [ "$1" != "" ]
2
- then
3
- if [ "$2" != "" ]
4
- then
5
- if [ "$3" != "" ]
6
- then
1
+ nodeswitchAPPDATA=$(cygpath -u $APPDATA)
2
+
3
+ if [ "$1" != "" ]; then
4
+ if [ "$2" != "" ]; then
5
+ if [ "$3" != "" ]; then
7
6
  echo "Incorrect command"
8
7
  else
9
- if [ "$1" = "remove" ]
10
- then
11
- if [ -d "$APPDATA/nodeswitch/$2" ]
12
- then
13
- rm -rf $APPDATA/nodeswitch/$2
8
+ if [ "$1" = "remove" ]; then
9
+ if [ -d "$nodeswitchAPPDATA/nodeswitch/$2" ]; then
10
+ rm -rf $nodeswitchAPPDATA/nodeswitch/$2
14
11
  else
15
12
  echo "Node version not installed"
16
13
  fi
17
- elif [ "$1" = "use" ]
18
- then
19
- if [ "$2" = "default" ]
20
- then
21
- if [ ! -z "$nodeswitchDefaultPATH" ]
22
- then
14
+ elif [ "$1" = "use" ]; then
15
+ if [ "$2" = "default" ]; then
16
+ if [ ! -z "$nodeswitchDefaultPATH" ]; then
23
17
  export PATH=$nodeswitchDefaultPATH
24
18
  fi
25
19
  else
26
- if [ -d "$APPDATA/nodeswitch/$2" ]
27
- then
28
- if [ -z "$nodeswitchDefaultPATH" ]
29
- then
20
+ if [ -d "$nodeswitchAPPDATA/nodeswitch/$2" ]; then
21
+ if [ -z "$nodeswitchDefaultPATH" ]; then
30
22
  export nodeswitchDefaultPATH=$PATH
31
- export PATH=$APPDATA/nodeswitch/$2:$PATH
23
+ export PATH=$nodeswitchAPPDATA/nodeswitch/$2:$PATH
32
24
  else
33
- export PATH=$APPDATA/nodeswitch/$2:$nodeswitchDefaultPATH
25
+ export PATH=$nodeswitchAPPDATA/nodeswitch/$2:$nodeswitchDefaultPATH
34
26
  fi
35
27
  else
36
28
  echo "Node version not installed"
37
29
  fi
38
30
  fi
39
- elif [ "$1" = "add" ]
40
- then
41
- if [ ! -d "$APPDATA/nodeswitch/$2" ]
42
- then
31
+ elif [ "$1" = "add" ]; then
32
+ if [ ! -d "$nodeswitchAPPDATA/nodeswitch/$2" ]; then
43
33
  curl -f https://nodejs.org/download/release/v$2/ &>/dev/null
44
- if [ $? -eq 0 ]
45
- then
46
- curl -s -o $APPDATA/nodeswitch/$2.zip https://nodejs.org/download/release/v$2/node-v$2-win-x64.zip > /dev/null
34
+ if [ $? -eq 0 ]; then
35
+ curl -s -o $nodeswitchAPPDATA/nodeswitch/$2.zip https://nodejs.org/download/release/v$2/node-v$2-win-x64.zip > /dev/null
47
36
 
48
- if [ $? -ne 0 ]
49
- then
50
- rm $APPDATA/nodeswitch/$2.zip
37
+ if [ $? -ne 0 ]; then
38
+ rm $nodeswitchAPPDATA/nodeswitch/$2.zip
51
39
  echo "Node version not created"
52
- exit
40
+ return 1
53
41
  fi
54
42
 
55
- unzip -d $APPDATA/nodeswitch -o $APPDATA/nodeswitch/$2.zip > /dev/null
43
+ unzip -d $nodeswitchAPPDATA/nodeswitch -o $nodeswitchAPPDATA/nodeswitch/$2.zip > /dev/null
56
44
 
57
- if [ $? -ne 0 ]
58
- then
59
- rm $APPDATA/nodeswitch/$2.zip
60
- rm -rf $APPDATA/nodeswitch/node-v$2-win-x64
45
+ if [ $? -ne 0 ]; then
46
+ rm $nodeswitchAPPDATA/nodeswitch/$2.zip
47
+ rm -rf $nodeswitchAPPDATA/nodeswitch/node-v$2-win-x64
61
48
  echo "Node version not created"
62
- exit
49
+ return 1
63
50
  fi
64
51
 
65
- rm $APPDATA/nodeswitch/$2.zip
66
- mv $APPDATA/nodeswitch/node-v$2-win-x64 $APPDATA/nodeswitch/$2 > /dev/null
52
+ rm $nodeswitchAPPDATA/nodeswitch/$2.zip
53
+ mv $nodeswitchAPPDATA/nodeswitch/node-v$2-win-x64 $nodeswitchAPPDATA/nodeswitch/$2 > /dev/null
67
54
  else
68
55
  echo "Node version not found"
69
56
  fi
@@ -75,15 +62,10 @@ then
75
62
  fi
76
63
  fi
77
64
  else
78
- if [ "$1" = "list" ]
79
- then
80
- dir -1 $APPDATA/nodeswitch
81
- elif [ "$1" = "path" ]
82
- then
65
+ if [ "$1" = "list" ]; then
66
+ dir -1 $nodeswitchAPPDATA/nodeswitch
67
+ elif [ "$1" = "path" ]; then
83
68
  echo "$APPDATA\nodeswitch"
84
- elif [ "$1" = "pathopen" ]
85
- then
86
- start explorer $(nodeswitch path)
87
69
  else
88
70
  echo "Incorrect command"
89
71
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodeswitch",
3
- "version": "1.9.4",
3
+ "version": "1.9.7",
4
4
  "description": "Node version switcher for Microsoft Windows x64",
5
5
  "scripts": {
6
6
  "preinstall": "node scripts/preinstall.js",
@@ -17,3 +17,6 @@
17
17
  "x64"
18
18
  ]
19
19
  }
20
+
21
+
22
+