Skip to content
This repository was archived by the owner on Jan 12, 2025. It is now read-only.

Commit cf4ea30

Browse files
[Bug]: Angular CLI is installed before Node (#567)
Fixes #558
1 parent 79fbfc5 commit cf4ea30

File tree

248 files changed

+2178
-2483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

248 files changed

+2178
-2483
lines changed

src/amplify-cli/devcontainer-feature.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "amplify-cli",
3-
"version": "2.0.14",
3+
"version": "2.0.15",
44
"name": "AWS Amplify CLI (via npm)",
55
"documentationURL": "http://github.com/devcontainers-contrib/features/tree/main/src/amplify-cli",
66
"description": "The Amplify Command Line Interface (CLI) is a unified toolchain to create AWS cloud services for your app. Let's go ahead and install the Amplify CLI.",
@@ -15,6 +15,7 @@
1515
}
1616
},
1717
"installsAfter": [
18-
"ghcr.io/devcontainers-contrib/features/npm-package"
18+
"ghcr.io/devcontainers-contrib/features/npm-package",
19+
"ghcr.io/devcontainers/features/node"
1920
]
2021
}

src/amplify-cli/install.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
#!/bin/bash -i
21

32
set -e
43

5-
source ./library_scripts.sh
4+
. ./library_scripts.sh
65

76
# nanolayer is a cli utility which keeps container layers as small as possible
87
# source code: https://github.com/devcontainers-contrib/nanolayer
98
# `ensure_nanolayer` is a bash function that will find any existing nanolayer installations,
109
# and if missing - will download a temporary copy that automatically get deleted at the end
1110
# of the script
12-
ensure_nanolayer nanolayer_location "v0.4.39"
11+
ensure_nanolayer nanolayer_location "v0.5.5"
1312

1413

1514
$nanolayer_location \

src/amplify-cli/library_scripts.sh

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/bin/bash -i
21

32

43
clean_download() {
@@ -10,13 +9,13 @@ clean_download() {
109
# The above steps will minimize the leftovers being created while installing the downloader
1110
# Supported distros:
1211
# debian/ubuntu/alpine
13-
12+
1413
url=$1
1514
output_location=$2
1615
tempdir=$(mktemp -d)
1716
downloader_installed=""
1817

19-
function _apt_get_install() {
18+
_apt_get_install() {
2019
tempdir=$1
2120

2221
# copy current state of apt list - in order to revert back later (minimize contianer layer size)
@@ -25,7 +24,7 @@ clean_download() {
2524
apt-get -y install --no-install-recommends wget ca-certificates
2625
}
2726

28-
function _apt_get_cleanup() {
27+
_apt_get_cleanup() {
2928
tempdir=$1
3029

3130
echo "removing wget"
@@ -36,15 +35,15 @@ clean_download() {
3635
rm -r /var/lib/apt/lists && mv $tempdir/lists /var/lib/apt/lists
3736
}
3837

39-
function _apk_install() {
38+
_apk_install() {
4039
tempdir=$1
4140
# copy current state of apk cache - in order to revert back later (minimize contianer layer size)
4241
cp -p -R /var/cache/apk $tempdir
4342

4443
apk add --no-cache wget
4544
}
4645

47-
function _apk_cleanup() {
46+
_apk_cleanup() {
4847
tempdir=$1
4948

5049
echo "removing wget"
@@ -100,45 +99,39 @@ ensure_nanolayer() {
10099
local variable_name=$1
101100

102101
local required_version=$2
103-
# normalize version
104-
if ! [[ $required_version == v* ]]; then
105-
required_version=v$required_version
106-
fi
107102

108-
local nanolayer_location=""
103+
local __nanolayer_location=""
109104

110105
# If possible - try to use an already installed nanolayer
111-
if [[ -z "${NANOLAYER_FORCE_CLI_INSTALLATION}" ]]; then
112-
if [[ -z "${NANOLAYER_CLI_LOCATION}" ]]; then
106+
if [ -z "${NANOLAYER_FORCE_CLI_INSTALLATION}" ]; then
107+
if [ -z "${NANOLAYER_CLI_LOCATION}" ]; then
113108
if type nanolayer >/dev/null 2>&1; then
114109
echo "Found a pre-existing nanolayer in PATH"
115-
nanolayer_location=nanolayer
110+
__nanolayer_location=nanolayer
116111
fi
117112
elif [ -f "${NANOLAYER_CLI_LOCATION}" ] && [ -x "${NANOLAYER_CLI_LOCATION}" ] ; then
118-
nanolayer_location=${NANOLAYER_CLI_LOCATION}
119-
echo "Found a pre-existing nanolayer which were given in env variable: $nanolayer_location"
113+
__nanolayer_location=${NANOLAYER_CLI_LOCATION}
114+
echo "Found a pre-existing nanolayer which were given in env variable: $__nanolayer_location"
120115
fi
121116

122117
# make sure its of the required version
123-
if ! [[ -z "${nanolayer_location}" ]]; then
118+
if ! [ -z "${__nanolayer_location}" ]; then
124119
local current_version
125-
current_version=$($nanolayer_location --version)
126-
if ! [[ $current_version == v* ]]; then
127-
current_version=v$current_version
128-
fi
120+
current_version=$($__nanolayer_location --version)
121+
129122

130123
if ! [ $current_version == $required_version ]; then
131124
echo "skipping usage of pre-existing nanolayer. (required version $required_version does not match existing version $current_version)"
132-
nanolayer_location=""
125+
__nanolayer_location=""
133126
fi
134127
fi
135128

136129
fi
137130

138131
# If not previuse installation found, download it temporarly and delete at the end of the script
139-
if [[ -z "${nanolayer_location}" ]]; then
132+
if [ -z "${__nanolayer_location}" ]; then
140133

141-
if [ "$(uname -sm)" == "Linux x86_64" ] || [ "$(uname -sm)" == "Linux aarch64" ]; then
134+
if [ "$(uname -sm)" = 'Linux x86_64' ] || [ "$(uname -sm)" = "Linux aarch64" ]; then
142135
tmp_dir=$(mktemp -d -t nanolayer-XXXXXXXXXX)
143136

144137
clean_up () {
@@ -162,7 +155,7 @@ ensure_nanolayer() {
162155

163156
tar xfzv $tmp_dir/$tar_filename -C "$tmp_dir"
164157
chmod a+x $tmp_dir/nanolayer
165-
nanolayer_location=$tmp_dir/nanolayer
158+
__nanolayer_location=$tmp_dir/nanolayer
166159

167160

168161
else
@@ -172,7 +165,7 @@ ensure_nanolayer() {
172165
fi
173166

174167
# Expose outside the resolved location
175-
declare -g ${variable_name}=$nanolayer_location
168+
export ${variable_name}=$__nanolayer_location
176169

177170
}
178171

src/angular-cli/devcontainer-feature.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "angular-cli",
3-
"version": "2.0.14",
3+
"version": "2.0.15",
44
"name": "Angular CLI (via npm)",
55
"documentationURL": "http://github.com/devcontainers-contrib/features/tree/main/src/angular-cli",
66
"description": "Angular CLI is a command-line interface tool that you use to initialize, develop, scaffold, and maintain Angular applications directly from a command shell.",
@@ -15,6 +15,7 @@
1515
}
1616
},
1717
"installsAfter": [
18-
"ghcr.io/devcontainers-contrib/features/npm-package"
18+
"ghcr.io/devcontainers-contrib/features/npm-package",
19+
"ghcr.io/devcontainers/features/node"
1920
]
2021
}

src/angular-cli/install.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
#!/bin/bash -i
21

32
set -e
43

5-
source ./library_scripts.sh
4+
. ./library_scripts.sh
65

76
# nanolayer is a cli utility which keeps container layers as small as possible
87
# source code: https://github.com/devcontainers-contrib/nanolayer
98
# `ensure_nanolayer` is a bash function that will find any existing nanolayer installations,
109
# and if missing - will download a temporary copy that automatically get deleted at the end
1110
# of the script
12-
ensure_nanolayer nanolayer_location "v0.4.39"
11+
ensure_nanolayer nanolayer_location "v0.5.5"
1312

1413

1514
$nanolayer_location \

src/angular-cli/library_scripts.sh

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/bin/bash -i
21

32

43
clean_download() {
@@ -10,13 +9,13 @@ clean_download() {
109
# The above steps will minimize the leftovers being created while installing the downloader
1110
# Supported distros:
1211
# debian/ubuntu/alpine
13-
12+
1413
url=$1
1514
output_location=$2
1615
tempdir=$(mktemp -d)
1716
downloader_installed=""
1817

19-
function _apt_get_install() {
18+
_apt_get_install() {
2019
tempdir=$1
2120

2221
# copy current state of apt list - in order to revert back later (minimize contianer layer size)
@@ -25,7 +24,7 @@ clean_download() {
2524
apt-get -y install --no-install-recommends wget ca-certificates
2625
}
2726

28-
function _apt_get_cleanup() {
27+
_apt_get_cleanup() {
2928
tempdir=$1
3029

3130
echo "removing wget"
@@ -36,15 +35,15 @@ clean_download() {
3635
rm -r /var/lib/apt/lists && mv $tempdir/lists /var/lib/apt/lists
3736
}
3837

39-
function _apk_install() {
38+
_apk_install() {
4039
tempdir=$1
4140
# copy current state of apk cache - in order to revert back later (minimize contianer layer size)
4241
cp -p -R /var/cache/apk $tempdir
4342

4443
apk add --no-cache wget
4544
}
4645

47-
function _apk_cleanup() {
46+
_apk_cleanup() {
4847
tempdir=$1
4948

5049
echo "removing wget"
@@ -100,45 +99,39 @@ ensure_nanolayer() {
10099
local variable_name=$1
101100

102101
local required_version=$2
103-
# normalize version
104-
if ! [[ $required_version == v* ]]; then
105-
required_version=v$required_version
106-
fi
107102

108-
local nanolayer_location=""
103+
local __nanolayer_location=""
109104

110105
# If possible - try to use an already installed nanolayer
111-
if [[ -z "${NANOLAYER_FORCE_CLI_INSTALLATION}" ]]; then
112-
if [[ -z "${NANOLAYER_CLI_LOCATION}" ]]; then
106+
if [ -z "${NANOLAYER_FORCE_CLI_INSTALLATION}" ]; then
107+
if [ -z "${NANOLAYER_CLI_LOCATION}" ]; then
113108
if type nanolayer >/dev/null 2>&1; then
114109
echo "Found a pre-existing nanolayer in PATH"
115-
nanolayer_location=nanolayer
110+
__nanolayer_location=nanolayer
116111
fi
117112
elif [ -f "${NANOLAYER_CLI_LOCATION}" ] && [ -x "${NANOLAYER_CLI_LOCATION}" ] ; then
118-
nanolayer_location=${NANOLAYER_CLI_LOCATION}
119-
echo "Found a pre-existing nanolayer which were given in env variable: $nanolayer_location"
113+
__nanolayer_location=${NANOLAYER_CLI_LOCATION}
114+
echo "Found a pre-existing nanolayer which were given in env variable: $__nanolayer_location"
120115
fi
121116

122117
# make sure its of the required version
123-
if ! [[ -z "${nanolayer_location}" ]]; then
118+
if ! [ -z "${__nanolayer_location}" ]; then
124119
local current_version
125-
current_version=$($nanolayer_location --version)
126-
if ! [[ $current_version == v* ]]; then
127-
current_version=v$current_version
128-
fi
120+
current_version=$($__nanolayer_location --version)
121+
129122

130123
if ! [ $current_version == $required_version ]; then
131124
echo "skipping usage of pre-existing nanolayer. (required version $required_version does not match existing version $current_version)"
132-
nanolayer_location=""
125+
__nanolayer_location=""
133126
fi
134127
fi
135128

136129
fi
137130

138131
# If not previuse installation found, download it temporarly and delete at the end of the script
139-
if [[ -z "${nanolayer_location}" ]]; then
132+
if [ -z "${__nanolayer_location}" ]; then
140133

141-
if [ "$(uname -sm)" == "Linux x86_64" ] || [ "$(uname -sm)" == "Linux aarch64" ]; then
134+
if [ "$(uname -sm)" = 'Linux x86_64' ] || [ "$(uname -sm)" = "Linux aarch64" ]; then
142135
tmp_dir=$(mktemp -d -t nanolayer-XXXXXXXXXX)
143136

144137
clean_up () {
@@ -162,7 +155,7 @@ ensure_nanolayer() {
162155

163156
tar xfzv $tmp_dir/$tar_filename -C "$tmp_dir"
164157
chmod a+x $tmp_dir/nanolayer
165-
nanolayer_location=$tmp_dir/nanolayer
158+
__nanolayer_location=$tmp_dir/nanolayer
166159

167160

168161
else
@@ -172,7 +165,7 @@ ensure_nanolayer() {
172165
fi
173166

174167
# Expose outside the resolved location
175-
declare -g ${variable_name}=$nanolayer_location
168+
export ${variable_name}=$__nanolayer_location
176169

177170
}
178171

src/assemblyscript/devcontainer-feature.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "assemblyscript",
3-
"version": "2.0.14",
3+
"version": "2.0.15",
44
"name": "AssemblyScript (via npm)",
55
"documentationURL": "http://github.com/devcontainers-contrib/features/tree/main/src/assemblyscript",
66
"description": "AssemblyScript compiles a variant of TypeScript to WebAssembly using Binaryen.",
@@ -15,6 +15,7 @@
1515
}
1616
},
1717
"installsAfter": [
18-
"ghcr.io/devcontainers-contrib/features/npm-package"
18+
"ghcr.io/devcontainers-contrib/features/npm-package",
19+
"ghcr.io/devcontainers/features/node"
1920
]
2021
}

src/assemblyscript/install.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
#!/bin/bash -i
21

32
set -e
43

5-
source ./library_scripts.sh
4+
. ./library_scripts.sh
65

76
# nanolayer is a cli utility which keeps container layers as small as possible
87
# source code: https://github.com/devcontainers-contrib/nanolayer
98
# `ensure_nanolayer` is a bash function that will find any existing nanolayer installations,
109
# and if missing - will download a temporary copy that automatically get deleted at the end
1110
# of the script
12-
ensure_nanolayer nanolayer_location "v0.4.39"
11+
ensure_nanolayer nanolayer_location "v0.5.5"
1312

1413

1514
$nanolayer_location \

0 commit comments

Comments
 (0)