Files
2023-05-17 12:07:28 -04:00

21 lines
1014 B
Plaintext
Executable File

#!/usr/bin/with-contenv bash
echo "**** installing nodejs dev environment ****"
source /etc/lsb-release
NODEJS_MOD_VERSION=${NODEJS_MOD_VERSION:-14}
if [[ ! -f "/etc/apt/sources.list.d/nodesource.list" ]]; then
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODEJS_MOD_VERSION}.x ${DISTRIB_CODENAME} main" \
> /etc/apt/sources.list.d/nodesource.list
fi
if [[ ! -f "/etc/apt/sources.list.d/yarn.list" ]]; then
curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnsource.gpg >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/yarnsource.gpg] https://dl.yarnpkg.com/debian/ stable main' \
> /etc/apt/sources.list.d/yarn.list
fi
echo "**** Adding nodejs and yarn to package install list ****"
echo "\
nodejs \
yarn" >> /mod-repo-packages-to-install.list