#!/bin/bash # little shortcut for doing npm install/update/whatever for each of our # gems that do node-y stuff # canvas (mis|ab)uses devDependencies, we try not to for these ones # though... only get their prod deps by default. if you are testing/ # developing one of these, go into the dir and yarn there export NODE_ENV=production for path in $(ls -1 gems/{,plugins/}*/package.json 2> /dev/null); do pushd $(dirname $path) > /dev/null if hash yarn 2>/dev/null; then echo "running yarn $1 for $path" yarn $1 else echo "npm is deprecated in canvas-lms. You should start using yarn instead. see https://yarnpkg.com. Running npm $1 for $path" npm $1 fi popd > /dev/null done