Skip to content

Commit

Permalink
Update install script for composer
Browse files Browse the repository at this point in the history
Add support for nvm.
  • Loading branch information
Jelle-S committed Aug 10, 2023
1 parent 64b6da5 commit a921cd8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
#!/bin/bash

NPM_COMMAND=(npm install)

# Check if npm is installed on your system.
if ! [ -x "$(command -v npm)" ]; then
echo 'Error: npm is not installed. Please install npm globally to execute this script.' >&2
exit 1
fi

# Check if nvm is available
if ! [ -x "$(command -v nvm)" ]; then
if [ -f ~/.nvm/nvm.sh ]; then
. ~/.nvm/nvm.sh;
NPM_COMMAND=(nvm exec npm install);
fi
else
NPM_COMMAND=(nvm exec npm install);
fi

echo "Removing old gent_base 'build' directory...";
rm -rf ../build;

Expand All @@ -14,7 +26,7 @@ mkdir ../build;

echo "Building gent_base...";
cd ../source;
npm install;
"${NPM_COMMAND[@]}"
mkdir -p ../build/@digipolis-gent/modal;
cp -R ./node_modules/@digipolis-gent/modal/dist/index.js ../build/@digipolis-gent/modal;
cp -R ./node_modules/gent_styleguide/build/styleguide ../build;
Expand Down
2 changes: 1 addition & 1 deletion source/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.14.0
v18

0 comments on commit a921cd8

Please sign in to comment.