2022-07-20 00:51:33 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# This script is meant to be called by another script defined in each flavour
|
|
|
|
# It cycles through a list of extensions (provided in args) and installs their JS deps, if any
|
|
|
|
|
|
|
|
DEPS=${1}
|
2022-12-23 05:25:18 +00:00
|
|
|
# TOOL="npm install"
|
|
|
|
TOOL=yarn
|
2022-07-20 00:51:33 +00:00
|
|
|
|
2022-12-23 05:25:18 +00:00
|
|
|
command -v $TOOL || (command -v npm && npm -g install $TOOL) || echo "$TOOL is required to install JS deps!"
|
2022-11-29 20:16:45 +00:00
|
|
|
|
2022-07-20 00:51:33 +00:00
|
|
|
for dep in $DEPS ; do
|
|
|
|
|
2022-11-29 04:03:36 +00:00
|
|
|
if cd "extensions/$dep/assets" 2>/dev/null ; then
|
2022-12-23 05:25:18 +00:00
|
|
|
echo "Install JS deps from extension 'extensions/$dep' with args '$2'"
|
|
|
|
$TOOL $2
|
2022-07-20 00:51:33 +00:00
|
|
|
cd ../../../
|
|
|
|
fi
|
|
|
|
|
2022-11-29 20:16:45 +00:00
|
|
|
if cd "forks/$dep/assets" 2>/dev/null ; then
|
2022-12-23 05:25:18 +00:00
|
|
|
echo "Install JS deps from extension 'forks/$dep' with args '$2'"
|
|
|
|
$TOOL $2
|
2022-11-29 20:16:45 +00:00
|
|
|
cd ../../../
|
|
|
|
fi
|
|
|
|
|
2022-07-20 00:51:33 +00:00
|
|
|
if cd "deps/$dep/assets" 2>/dev/null ; then
|
2022-12-23 05:25:18 +00:00
|
|
|
echo "Install JS deps from extension 'deps/$dep' with args '$2'"
|
|
|
|
$TOOL $2
|
2022-07-20 00:51:33 +00:00
|
|
|
cd ../../../
|
|
|
|
else
|
|
|
|
echo "The extension '$dep' is not available\n"
|
|
|
|
fi
|
2022-11-29 20:16:45 +00:00
|
|
|
done
|