al-quran.reflectslight.io/bin/setup

40 lines
641 B
Text
Raw Normal View History

2024-06-22 06:47:55 +02:00
#!/bin/sh
set -e
##
# functions
printok()
{
echo "ok: ${1}" > /dev/stdout
}
printerr()
{
echo "error: ${1}" > /dev/stdout
}
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
}
2024-05-02 13:04:35 +02:00
##
# main
2024-06-22 06:47:55 +02:00
require_dependency git bundle npm
2024-05-02 13:23:02 +02:00
git submodule update -f --init --recursive
2024-06-22 06:47:55 +02:00
printok "submodules checked out"
2024-05-02 13:04:35 +02:00
bundle install
2024-06-22 06:47:55 +02:00
printok "ruby dependencies installed"
2024-05-02 13:04:35 +02:00
npm i
2024-06-22 06:47:55 +02:00
printok "nodejs dependencies installed"