2024-02-18 01:22:31 +01:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
2024-06-23 05:56:58 +02:00
|
|
|
|
|
|
|
##
|
|
|
|
# functions
|
|
|
|
printok()
|
|
|
|
{
|
|
|
|
echo "ok: ${1}" > /dev/stdout
|
|
|
|
}
|
|
|
|
|
|
|
|
printerr()
|
|
|
|
{
|
|
|
|
echo "error: ${1}" > /dev/stderr
|
|
|
|
}
|
|
|
|
|
|
|
|
require_dependency()
|
|
|
|
{
|
|
|
|
for i in $(seq 1 $#); do
|
|
|
|
eval "cmd=\$${i}"
|
|
|
|
if which ${cmd} > /dev/null 2>&1; then
|
|
|
|
printok "${cmd} found"
|
|
|
|
else
|
|
|
|
printerr "${cmd} is required but was not found on \$PATH"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
##
|
|
|
|
# main
|
|
|
|
require_dependency git bundle npm
|
2024-04-22 01:08:29 +02:00
|
|
|
subdir=". cli client server"
|
2024-06-23 05:56:58 +02:00
|
|
|
cwd=$(pwd)
|
2024-02-18 01:22:31 +01:00
|
|
|
for dir in ${subdir}; do
|
2024-06-23 05:56:58 +02:00
|
|
|
cd "${dir}"
|
2024-02-18 01:22:31 +01:00
|
|
|
bundle install
|
2024-06-23 05:56:58 +02:00
|
|
|
printok "ruby dependencies installed"
|
2024-02-18 01:22:31 +01:00
|
|
|
if [ -e "package.json" ]; then
|
|
|
|
npm i
|
2024-06-23 05:56:58 +02:00
|
|
|
printok "nodejs dependencies installed"
|
2024-02-18 01:22:31 +01:00
|
|
|
fi
|
2024-06-23 05:56:58 +02:00
|
|
|
cd "${cwd}"
|
2024-02-18 01:22:31 +01:00
|
|
|
done
|
2024-03-31 01:11:33 +01:00
|
|
|
git submodule update --init --recursive
|
2024-06-23 05:56:58 +02:00
|
|
|
printok "submodules checked out"
|