mktools/install.sh
Laurent Gourvénec 0a3d5add48
All checks were successful
Cadoles/mktools/pipeline/head This commit looks good
Cadoles/mktools/pipeline/pr-master This commit looks good
fix(install): don't use option '-e' for builtin echo
echo is often a builtin and '-e' is not an option for sh.
sh is the default shell for gnu make (variable "SHELL") -> this leads to an
extra "-e" in .gitignore
2025-05-28 15:26:38 +02:00

29 lines
660 B
Bash

#!/bin/bash
set -e
TASKS_DIR=".mktools"
TASKS="${TASKS:-webdav gitea changelog version checkmake}"
main() {
echo "Creating directory '$TASKS_DIR/'"
# Create $TASKS_DIR
mkdir -p "$TASKS_DIR"
# Download each referenced task files in $TASKS_DIR
for f in $TASKS; do
echo "Downloading file '$TASKS_DIR/$f.mk'"
curl -qo "$TASKS_DIR/$f.mk" "https://forge.cadoles.com/Cadoles/mktools/raw/branch/master/tasks/$f.mk"
done
# Add $TASKS_DIR to .gitignore
if [ ! -f .gitignore ]; then
touch .gitignore
fi
grep -qFx -- "$TASKS_DIR/" .gitignore || echo "$TASKS_DIR/" >> .gitignore
echo "Done"
}
main