Skip to content

Commit

Permalink
Install nvm in more places, utilise tna-npm
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Jan 8, 2025
1 parent 191c630 commit 2b515f4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 26 deletions.
11 changes: 2 additions & 9 deletions docker/tna-python-dev/bin/dev
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,8 @@ cd /app || return

poetry install --no-root --with dev || true

. "$HOME/.nvm/nvm.sh"
if [ -f "/app/.nvmrc" ]
then
nvm install
else
nvm use default
fi
npm install -g prettier@3.4.2 eslint@8.56.0 stylelint@16.12.0 stylelint-config-standard-scss@14.0.0 stylelint-selector-bem-pattern@4.0.1 stylelint-order@6.0.4
npm install
tna-npm install -g prettier@3.4.2 eslint@8.56.0 stylelint@16.12.0 stylelint-config-standard-scss@14.0.0 stylelint-selector-bem-pattern@4.0.1 stylelint-order@6.0.4
tna-npm install

if [ -d "/home/app/.local/bin/tasks" ]
then
Expand Down
8 changes: 1 addition & 7 deletions docker/tna-python-dev/bin/format
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ else
fi
echo

. "$HOME/.nvm/nvm.sh"
if [ -f "/app/.nvmrc" ]
then
nvm install
else
nvm use default
fi
tna-npm install

echo "Running prettier..."
prettier --write /app
Expand Down
9 changes: 1 addition & 8 deletions docker/tna-python-dev/bin/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,5 @@ fi

if [ -z "$1" ] || [ "$1" == "npm" ]; then
echo "Upgrading npm dependencies..."
. "$HOME/.nvm/nvm.sh"
if [ -f "/app/.nvmrc" ]
then
nvm install
else
nvm use default
fi
npm update
tna-npm update
fi
2 changes: 1 addition & 1 deletion docker/tna-python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ RUN mkdir /home/app/ssl
# run our application in a consistent manner
# ==========================================
COPY --chown=app bin /home/app/.local/bin
RUN chmod +x -R /home/app/.local/bin
RUN chmod +x -fR /home/app/.local/bin

# ==========================================
# This does nothing but will act as a way to
Expand Down
4 changes: 3 additions & 1 deletion docker/tna-python/bin/tna-npm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ then
. "$NVM_DIR/nvm.sh" && true
if [ -f "/app/.nvmrc" ]
then
nvm use "$(cat /app/.nvmrc)" --silent
NVM_NODE_VERSION=$(cat /app/.nvmrc)
nvm install $NVM_NODE_VERSION
nvm use $NVM_NODE_VERSION --silent
else
nvm use default --silent
fi
Expand Down

0 comments on commit 2b515f4

Please # to comment.