feat: initial commit
This commit is contained in:
commit
58de059b02
37
README.md
Normal file
37
README.md
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# MkTools
|
||||||
|
|
||||||
|
Tâches [Make]() génériques à utiliser de projet en projet.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Utilisation
|
||||||
|
|
||||||
|
1. Dans le fichier `Makefile` de votre projet, ajouter à la fin de celui ci:
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
build:
|
||||||
|
# Votre propre tâche
|
||||||
|
|
||||||
|
# [...]
|
||||||
|
|
||||||
|
# Inclure les lignes suivantes:
|
||||||
|
|
||||||
|
mktools:
|
||||||
|
curl -q https://forge.cadoles.com/Cadoles/make-tools/raw/branch/master/install.sh | $(SHELL)
|
||||||
|
|
||||||
|
-include .mktools/*.mk
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Synchroniser le répertoire des tâches
|
||||||
|
|
||||||
|
```shell
|
||||||
|
make mktools
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Vous pouvez commencer à utiliser les tâches Make partagées !
|
||||||
|
|
||||||
|
## Tâches disponibles
|
||||||
|
|
||||||
|
|Tâches|Description|Documentation|
|
||||||
|
|------|-----------|-------------|
|
||||||
|
|`make mkt-webdav-upload`|Téléverser un fichier dans un répertoire WebDAV (Nextcloud)|[Voir ./doc/tasks/webdav.md](./doc/tasks/webdav.md)|
|
3
doc/tasks/webdav.md
Normal file
3
doc/tasks/webdav.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Tâches WebDAV
|
||||||
|
|
||||||
|
## `make mkt-webdav-upload`
|
25
install.sh
Normal file
25
install.sh
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
TASKS_DIR=.mktools
|
||||||
|
TASKS_FILES="webdav"
|
||||||
|
|
||||||
|
main() {
|
||||||
|
# Create $TASKS_DIR
|
||||||
|
mkdir -p "$TASKS_DIR"
|
||||||
|
|
||||||
|
# Download each referenced task files in $TASKS_DIR
|
||||||
|
for f in $TASKS_FILES; do
|
||||||
|
curl -o "$TASKS_DIR/$f.mk" "https://forge.cadoles.com/Cadoles/make-tools/raw/branch/master/tasks/$f.mk"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Ignore $TASKS_DIR
|
||||||
|
|
||||||
|
if [ -f .gitignore ]; then
|
||||||
|
touch .gitignore
|
||||||
|
fi
|
||||||
|
grep -qF -- "$TASKS_DIR/" ".gitignore" || echo "$TASKS_DIR/" >> ".gitignore"
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
BIN
misc/share_all.png
Normal file
BIN
misc/share_all.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
19
tasks/webdav.mk
Normal file
19
tasks/webdav.mk
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
MKT_WEBDAV_USER ?=
|
||||||
|
MKT_WEBDAV_PASSWD ?=
|
||||||
|
MKT_WEBDAV_REMOTE_URL ?=
|
||||||
|
MKT_WEBDAV_DIR ?=
|
||||||
|
MKT_WEBDAV_FILE ?=
|
||||||
|
|
||||||
|
mkt-webdav-upload:
|
||||||
|
curl \
|
||||||
|
-f \
|
||||||
|
-u '$(MKT_WEBDAV_USER):$(MKT_WEBDAV_PASSWD)' \
|
||||||
|
-X MKCOL \
|
||||||
|
"$(MKT_WEBDAV_REMOTE_URL)/$(MKT_WEBDAV_DIR)"
|
||||||
|
curl \
|
||||||
|
-f \
|
||||||
|
-u '$(MKT_WEBDAV_USER):$(MKT_WEBDAV_PASSWD)' \
|
||||||
|
-T "$(PWD)/$(MKT_WEBDAV_FILE)" \
|
||||||
|
"$(MKT_WEBDAV_REMOTE_URL)/$(MKT_WEBDAV_DIR)/$(shell basename $(MKT_WEBDAV_FILE))"
|
||||||
|
|
||||||
|
.PHONY: mkt-webdav-upload
|
Loading…
x
Reference in New Issue
Block a user