-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnodejs.sh
More file actions
42 lines (35 loc) · 846 Bytes
/
nodejs.sh
File metadata and controls
42 lines (35 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
if [ -z ${BASH_COMMON_DEFINE+x} ]; then
if [ ! -f ./common.sh ]; then
source <(curl -s https://amusdev.github.io/bash/common.sh)
else
source ./common.sh
fi
fi
# check_env from common.sh
check_env
# common.sh
import_from_local_or_remote modules/nodejs.sh
while getopts "v:n:" args;
do
case "${args}" in
v)
NODEJS_VERSION=${OPTARG}
;;
n)
NPM_VERSION=${OPTARG}
;;
*)
;;
esac
done
if [ -z "$NODEJS_VERSION" ]; then
require_nodejs_version_from_cli NODEJS_VERSION
fi
if [ -z "$NPM_VERSION" ]; then
require_npm_version_from_cli NPM_VERSION
fi
install_nodejs_check_available $NODEJS_VERSION $NPM_VERSION
install_nodejs $NODEJS_VERSION $NPM_VERSION
tput reset
print_nodejs_finish $NODEJS_VERSION $NPM_VERSION