mktools/install.sh
William Petit dd31e0acd6
Some checks reported errors
Cadoles/mktools/pipeline/head Something is wrong with the build of this commit
fix(install): correctly inject tools dir into gitignore
2023-11-15 11:10:36 +01:00

28 lines
664 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 -qF -- "$TASKS_DIR/" ".gitignore" || echo "\n$TASKS_DIR/" >> ".gitignore"
echo "Done"
}
main