commit 09ef666ed03b3d5af6bc2d951931bf7858ce3cdb Author: William Petit Date: Mon Aug 21 19:08:40 2023 -0600 feat: initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..30e0d0a --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# Make Tools + +Tâches [Make]() génériques à utiliser de projet en projet. + +![](./misc/share_all.png) + +## Utilisation + +1. Créer un fichier `Makefile` à la racine de votre projet: + + ```makefile + .inc: + curl -q https://forge.cadoles.com/Cadoles/make-tools/install.sh | $(SHELL) + + -include .inc/*.mk + ``` + +2. Ajouter le répertoire `.inc` dans les fichiers ignorés par Git + + ``` + echo '.inc/' >> .gitignore + ``` + +3. Vous pouvez commencer à utiliser les tâches Make partagées ! \ No newline at end of file diff --git a/inc/webdav.mk b/inc/webdav.mk new file mode 100644 index 0000000..327d936 --- /dev/null +++ b/inc/webdav.mk @@ -0,0 +1,17 @@ +WEBDAV_USER ?= +WEBDAV_PASSWD ?= +WEBDAV_REMOTE_URL ?= +WEBDAV_DIR ?= +WEBDAV_FILE ?= + +webdav-upload: + curl \ + -u '$(WEBDAV_USER):$(WEBDAV_PASSWD)' \ + -X MKCOL \ + "$(WEBDAV_REMOTE_URL)/$(WEBDAV_DIR)" + curl \ + -u '$(WEBDAV_USER):$(WEBDAV_PASSWD)' \ + -T "$(PWD)/$(WEBDAV_FILE)" \ + "$(WEBDAV_REMOTE_URL)/$(WEBDAV_DIR)/$(shell basename $(WEBDAV_FILE))" + +.PHONY: webdav-upload \ No newline at end of file diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..b1d4472 --- /dev/null +++ b/install.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +INC_DIR=.inc +INC_FILES="webdav " + +main() { + mkdir -p "$INC_DIR" + for f in $INC_FILES; do + curl -o "$INC_DIR/$f.mk" https://forge.cadoles.com/Cadoles/make-tools + done +} + +main \ No newline at end of file diff --git a/misc/share_all.png b/misc/share_all.png new file mode 100644 index 0000000..78a7e6b Binary files /dev/null and b/misc/share_all.png differ