@@ -10,14 +10,50 @@ pushd $repodir
1010
1111arch=$( uname -m)
1212if [[ $arch == ' x86_64' ]]; then
13- shortarch=' x86 '
13+ shortarch=' x64 '
1414else
1515 shortarch=$arch
1616fi
1717if [[ $( uname -s) == ' Linux' ]]; then
1818 os=linux
1919 installer=' sudo yum -y'
2020 shellrc=' .bashrc'
21+ if [ -f /etc/os-release ]; then
22+ . /etc/os-release
23+ case " $ID -$VERSION_ID " in
24+ " amzn-2" * )
25+ echo " error: Unsupported OS $( uname -s) "
26+ return 1
27+ ;;
28+ " centos-7" * )
29+ echo " error: Unsupported OS $( uname -s) "
30+ return 1
31+ ;;
32+ " centos-8" * )
33+ echo " error: Unsupported OS $( uname -s) "
34+ return 1
35+ ;;
36+ " rhel-7" * )
37+ echo " error: Unsupported OS $( uname -s) "
38+ return 1
39+ ;;
40+ " rhel-8" * )
41+ distro=" rhel8"
42+ ;;
43+ " rhel-9" * )
44+ distro=" rhel9"
45+ ;;
46+ " rocky-8" * )
47+ distro=" rocky8"
48+ ;;
49+ " rocky-9" * )
50+ distro=" rocky9"
51+ ;;
52+ esac
53+ else
54+ echo " error: Unsupported OS $( uname -s) "
55+ return 1
56+ fi
2157elif [[ $( uname -s) == ' Darwin' ]]; then
2258 os=macos
2359 installer=' brew'
@@ -61,12 +97,7 @@ echo "Using python $python_version"
6197
6298# Check nodejs version
6399# https://nodejs.org/en/about/previous-releases
64- if [[ $os == ' macos' ]]; then
65- required_nodejs_version=20.19.0
66- else
67- # linux
68- required_nodejs_version=16.20.2
69- fi
100+ required_nodejs_version=20.19.0
70101# required_nodejs_version=18.20.2
71102# On Amazon Linux 2 and nodejs 18.20.2 I get the following errors:
72103# node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
@@ -107,7 +138,10 @@ if [[ $nodejs_version != $required_nodejs_version ]]; then
107138 nodedir=node-v${required_nodejs_version} -darwin-${shortarch}
108139 fi
109140 tarball=${nodedir} .tar.xz
110- wget https://nodejs.org/dist/v${required_nodejs_version} /$tarball
141+ if ! wget https://nodejs.org/dist/v${required_nodejs_version} /$tarball ; then
142+ echo " error: Couldn't download nodejs from https://nodejs.org/dist/v${required_nodejs_version} /$tarball ."
143+ return 1
144+ fi
111145 tar -xf $tarball
112146 rm $tarball
113147 cat >> ~ /$shellrc << EOF
@@ -117,6 +151,7 @@ export PATH=$HOME/$nodedir/bin:\$PATH
117151EOF
118152 source ~ /$shellrc
119153 popd
154+ nodejs_version=$required_nodejs_version
120155fi
121156
122157echo " Using nodejs version $nodejs_version "
@@ -138,6 +173,7 @@ if [[ $cdk_version != $CDK_VERSION ]]; then
138173 if ! npm install -g --force aws-cdk@$CDK_VERSION ; then
139174 sudo npm install -g --force aws-cdk@$CDK_VERSION
140175 fi
176+ cdk_version=$CDK_VERSION
141177fi
142178echo " Using CDK $cdk_version "
143179
0 commit comments