From 5faa00a815079c7a80fb2d62ba57f8dd6214df40 Mon Sep 17 00:00:00 2001 From: redxef Date: Fri, 6 May 2022 15:39:34 +0200 Subject: [PATCH] Add makefile. --- Makefile | 6 ++++++ src/scripts/get_file_meta.sh | 4 +++- src/scripts/get_files.sh | 9 +++++++-- src/scripts/put_files.sh | 3 +++ 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9201430 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +SOURCES := $(shell cd ./src && find ./ -type f -and -not -name '*.vars') + +shellcheck: + cd ./src && shellcheck ${SOURCES} + +.PHONY: shellcheck diff --git a/src/scripts/get_file_meta.sh b/src/scripts/get_file_meta.sh index 4a0f99d..cd5cbc7 100644 --- a/src/scripts/get_file_meta.sh +++ b/src/scripts/get_file_meta.sh @@ -2,7 +2,9 @@ set -e +# shellcheck disable=SC2153 directory="${DIRECTORY}" +# shellcheck disable=SC2153 files="${FILES}" if [ -z "$files" ]; then @@ -14,7 +16,7 @@ fi echo "$directory/$file" if [ -e "$directory/$file" ]; then echo true - echo "$(stat --format=%Y "$directory/$file")" + stat --format=%Y "$directory/$file" else echo false echo "# --PLACEHOLDER--" diff --git a/src/scripts/get_files.sh b/src/scripts/get_files.sh index 7e2c997..34cadcb 100644 --- a/src/scripts/get_files.sh +++ b/src/scripts/get_files.sh @@ -2,9 +2,14 @@ set -e +# shellcheck disable=SC2153 directory="${DIRECTORY}" +# shellcheck disable=SC2153 files="${FILES}" +newline_str=' +' ( - echo tar c $files >&2 - IFS=$'\n' tar c $files + cd "$directory" + #shellcheck disable=SC2086 + IFS="$newline_str" tar c $files ) diff --git a/src/scripts/put_files.sh b/src/scripts/put_files.sh index 07f72bc..55587a2 100644 --- a/src/scripts/put_files.sh +++ b/src/scripts/put_files.sh @@ -2,8 +2,11 @@ set -e +# shellcheck disable=SC2153 directory="${DIRECTORY}" +# shellcheck disable=SC2153 workdir="${WORKDIR}" +# shellcheck disable=SC2153 extract="${EXTRACT}" ( if "$extract"; then