File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55# Optional: Import test library
66source dev-container-features-test-lib
77
8- # 'lts' is now some version of node 20...
9- check " version_on_path" node -v | grep 20
8+ # Install jq if not already installed
9+ if ! type jq > /dev/null 2>&1 ; then
10+ apt-get update && apt-get install -y jq
11+ fi
12+
13+ # Get the latest LTS version of Node.js
14+ LATEST_LTS_VERSION=$( curl -s https://nodejs.org/dist/index.json | jq -r ' [.[] | select(.lts != false)][0].version' )
15+
16+
17+ # 'lts' is fetched instead of hardcoded to a specific version
18+ check " version_on_path" node -v | grep " $LATEST_LTS_VERSION "
1019check " pnpm" bash -c " pnpm -v | grep 8.8.0"
1120
12- check " v20_installed " ls -1 /usr/local/share/nvm/versions/node | grep 20
21+ check " lts_installed " ls -1 /usr/local/share/nvm/versions/node | grep " $LATEST_LTS_VERSION "
1322check " v14_installed" ls -1 /usr/local/share/nvm/versions/node | grep 14.19.3
1423check " v17_installed" ls -1 /usr/local/share/nvm/versions/node | grep 17.9.1
1524
Original file line number Diff line number Diff line change 55# Optional: Import test library
66source dev-container-features-test-lib
77
8- # 'lts' is now some version of node 20...
9- check " version_on_path" node -v | grep 20
8+ # Install jq if not already installed
9+ if ! type jq > /dev/null 2>&1 ; then
10+ yum install -y jq
11+ fi
12+
13+ # Get the latest LTS version of Node.js
14+ LATEST_LTS_VERSION=$( curl -s https://nodejs.org/dist/index.json | jq -r ' [.[] | select(.lts != false)][0].version' )
15+
16+ # 'lts' is fetched instead of hardcoded to a specific version
17+ check " version_on_path" node -v | grep " $LATEST_LTS_VERSION "
1018check " pnpm" bash -c " pnpm -v | grep 6.16.0"
1119
12- check " v20_installed " ls -1 /usr/local/share/nvm/versions/node | grep 20
20+ check " lts_installed " ls -1 /usr/local/share/nvm/versions/node | grep " $LATEST_LTS_VERSION "
1321check " v14_installed" ls -1 /usr/local/share/nvm/versions/node | grep 14.19.3
1422check " v17_installed" ls -1 /usr/local/share/nvm/versions/node | grep 17.9.1
1523
You can’t perform that action at this time.
0 commit comments