fix(install): correctly inject tools dir into gitignore

This commit is contained in:
wpetit 2023-11-15 11:10:36 +01:00
parent 541afcccfe
commit 6028362078
1 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@
set -e set -e
TASKS_DIR=".mktools" TASKS_DIR=".mktools"
TASKS_FILES="webdav gitea changelog version checkmake" TASKS="${TASKS:-webdav gitea changelog version checkmake}"
main() { main() {
echo "Creating directory '$TASKS_DIR/'" echo "Creating directory '$TASKS_DIR/'"
@ -11,7 +11,7 @@ main() {
mkdir -p "$TASKS_DIR" mkdir -p "$TASKS_DIR"
# Download each referenced task files in $TASKS_DIR # Download each referenced task files in $TASKS_DIR
for f in $TASKS_FILES; do for f in $TASKS; do
echo "Downloading file '$TASKS_DIR/$f.mk'" 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" curl -qo "$TASKS_DIR/$f.mk" "https://forge.cadoles.com/Cadoles/mktools/raw/branch/master/tasks/$f.mk"
done done
@ -20,7 +20,7 @@ main() {
if [ ! -f .gitignore ]; then if [ ! -f .gitignore ]; then
touch .gitignore touch .gitignore
fi fi
grep -qF -- "$TASKS_DIR/" ".gitignore" || echo "$TASKS_DIR/" >> ".gitignore" grep -qFx -- "$TASKS_DIR/" .gitignore || echo -e "$TASKS_DIR/" >> .gitignore
echo "Done" echo "Done"
} }