From 6f457fb7ddd3b18aecc88da2bc7dc6b4ed7b9e89 Mon Sep 17 00:00:00 2001 From: redxef Date: Tue, 30 Aug 2022 22:59:01 +0200 Subject: [PATCH] Add makefile and gitignore. --- .gitignore | 1 + Makefile | 11 +++++++++++ dvbackup.sh => dvbackup | 0 test/test.sh | 6 ++++++ 4 files changed, 18 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile rename dvbackup.sh => dvbackup (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..79c4bb1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +shellcheck.log diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..254c3aa --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +all: shellcheck + +shellcheck: shellcheck.log + +install: dvbackup shellcheck + install -Dm 0755 --owner=root --group=root $< /usr/local/bin/ + +shellcheck.log: dvbackup + shellcheck $< | tee $@ + +.PHONY: all shellcheck install diff --git a/dvbackup.sh b/dvbackup similarity index 100% rename from dvbackup.sh rename to dvbackup diff --git a/test/test.sh b/test/test.sh index f16c714..ebbf680 100755 --- a/test/test.sh +++ b/test/test.sh @@ -20,4 +20,10 @@ DOCKER=./mock-docker.sh DOCKER_MOCK_VOLUME="$VOLUME_NAME" \ ../dvbackup.sh restore_all "$VOLUME_NAME.tar" || exit 1 docker run --rm --volume="$VOLUME_NAME:/data" alpine \ sh -c 'stat /data/a.txt' || exit 1 + +DOCKER=./mock-docker.sh DOCKER_MOCK_VOLUME="$VOLUME_NAME-0" \ + ../dvbackup.sh restore_all "$VOLUME_NAME-0.tar" || exit 1 +docker run --rm --volume="$VOLUME_NAME-0:/data" alpine \ + sh -c 'stat /data/a.txt' || exit 1 + exit 0