devtools: install npm modules in devtools npm script
If the npm script is run and the node_modules
directory does not exist the script will run
npm install first.
Trust: Jamal Carvalho
source devtools/lib.sh || { echo "Are you at repo root?"; exit 1; }
+# Run npm install if node_modules directory does not exist.
+if [ ! -d "node_modules" ]
+then
+ runcmd docker-compose -f devtools/config/docker-compose.yaml run --rm npm install --quiet
+fi
+
# Run an npm command and capture the exit code.
runcmd docker-compose -f devtools/config/docker-compose.yaml run --rm npm $@
code=$EXIT_CODE
