source: gs3-extensions/selfcontained-nodejs/trunk/setup.bash.DEPRECATED@ 37490

Last change on this file since 37490 was 36448, checked in by davidb, 21 months ago

Shifting to the cli extension approach

File size: 1.2 KB
Line 
1
2nodejs_package=node-v16.13.2
3
4
5os_full_lc=`uname -s | tr '[:upper:]' '[:lower:]'`
6
7os_root=${os_full_lc%%_*}
8
9
10if [ "x$os_root" = "xlinux" ] ; then
11 nodejs_package=$nodejs_package-linux-x64
12 export PATH=$PWD/$nodejs_package/bin:$PATH
13 echo "Updated PATH to include node, npm and npx"
14
15 export NODE_PATH=$PWD/$nodejs_package/lib/node_modules
16 echo "Set NODE_PATH to include $nodejs_package/lib/node_modules"
17
18elif [ "x$os_root" = "xcygwin" ] ; then
19 nodejs_package=$nodejs_package-win-x64
20 export PATH=$PWD/$nodejs_package:$PATH
21 echo "Updated PATH to include node, npm and npx"
22else
23 echo "Unrecognized Operating System: $os" >&2
24 echo "Failed to update PATH to include node, npm and npx"
25 return
26fi
27
28if [ ! -d $nodejs_package ] ; then
29 echo "" >&2
30 echo "Warning: Failed to find directory:" >&2
31 echo " $nodejs_package" >&2
32 echo "" >&2
33 if [ "x$os_root" = "xcygwin" ] ; then
34 echo "Have you unzipped the NodeJS binary distribution?" >&2
35 echo "For example:" >&2
36 echo " unzip $nodejs_package.zip" >&2
37 else
38 echo "Have you untarred the NodeJS binary distribution?" >&2
39 echo "For example:" >&2
40 echo " tar xvzf $nodejs_package.tar.gz" >&2
41 fi
42 echo "" >&2
43 return
44fi
45
46
47
48
Note: See TracBrowser for help on using the repository browser.