Skip to content

Instantly share code, notes, and snippets.

@felipecesr
Last active February 9, 2021 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipecesr/839f40f52b4db733564d97faf1319f9e to your computer and use it in GitHub Desktop.
Save felipecesr/839f40f52b4db733564d97faf1319f9e to your computer and use it in GitHub Desktop.
#
# Script feito para alterar a versão do node nos projetos com serverless.
#
# Para executar abra o terminal e execute o comando:
# bash <(curl -Ls https://gist.githubusercontent.com/felipecesr/839f40f52b4db733564d97faf1319f9e/raw/43ea30fab7bf01917dd5069c032703b381cefd93/node_version.sh)
#
read -p "Enter the Node.js version (e.g. 12) : " node_version
sed -i -E "s/nodejs[0-9]+\.x/nodejs$node_version.x/g" serverless.yml
sed -i -E "s/node-version: [0-9]+\.x/node-version: $node_version.x/g" .github/workflows/ci.yml
for i in buildspec*.yml; do
sed -i -E "s/nodejs: [0-9]+/nodejs: $node_version/g" $i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment