mktools/install.sh

28 lines
662 B
Bash
Raw Normal View History

2023-08-22 03:08:40 +02:00
#!/bin/bash
set -e
TASKS_DIR=".mktools"
TASKS="${TASKS:-webdav gitea changelog version checkmake}"
2023-08-22 03:08:40 +02:00
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
2023-08-22 03:08:40 +02:00
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 -e "$TASKS_DIR/" >> .gitignore
2023-08-22 03:08:40 +02:00
echo "Done"
}
main