Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.sh reports wrong version of CDK and nodejs #278

Open
gwolski opened this issue Nov 3, 2024 · 0 comments
Open

setup.sh reports wrong version of CDK and nodejs #278

gwolski opened this issue Nov 3, 2024 · 0 comments

Comments

@gwolski
Copy link

gwolski commented Nov 3, 2024

When I run "source setup.sh"
It prints out the version of nodejs and CDK being used.
However, the output is wrong.

setup.sh sets up the nodejs in this section of code:

if [[ $nodejs_version != $required_nodejs_version ]]; then
echo "Updating nodejs version from $nodejs_version toe $required_nodejs_version"
pushd $HOME
wget https://nodejs.org/dist/v${required_nodejs_version}/node-v${required_nodejs_version}-linux-x64.tar.xz
tar -xf node-v${required_nodejs_version}-linux-x64.tar.xz
rm node-v${required_nodejs_version}-linux-x64.tar.xz
cat >> ~/.bashrc << EOF

Nodejs

export PATH=$HOME/node-v${required_nodejs_version}-linux-x64/bin:$PATH
EOF
source ~/.bashrc
popd
fi
echo "Using nodejs version $nodejs_version"

$nodejs_version is set before this code, and yet this code changes the installed version yet never calls the code to set the nodejs_version again:

nodejs_version=$(node -v 2>&1 | awk '{print $1}')
nodejs_version=${nodejs_version:1}

Same exists for CDK further down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant