Add makefile.

This commit is contained in:
redxef 2022-05-06 15:39:34 +02:00
parent d7696331d0
commit 5faa00a815
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921
4 changed files with 19 additions and 3 deletions

6
Makefile Normal file
View file

@ -0,0 +1,6 @@
SOURCES := $(shell cd ./src && find ./ -type f -and -not -name '*.vars')
shellcheck:
cd ./src && shellcheck ${SOURCES}
.PHONY: shellcheck

View file

@ -2,7 +2,9 @@
set -e set -e
# shellcheck disable=SC2153
directory="${DIRECTORY}" directory="${DIRECTORY}"
# shellcheck disable=SC2153
files="${FILES}" files="${FILES}"
if [ -z "$files" ]; then if [ -z "$files" ]; then
@ -14,7 +16,7 @@ fi
echo "$directory/$file" echo "$directory/$file"
if [ -e "$directory/$file" ]; then if [ -e "$directory/$file" ]; then
echo true echo true
echo "$(stat --format=%Y "$directory/$file")" stat --format=%Y "$directory/$file"
else else
echo false echo false
echo "# --PLACEHOLDER--" echo "# --PLACEHOLDER--"

View file

@ -2,9 +2,14 @@
set -e set -e
# shellcheck disable=SC2153
directory="${DIRECTORY}" directory="${DIRECTORY}"
# shellcheck disable=SC2153
files="${FILES}" files="${FILES}"
newline_str='
'
( (
echo tar c $files >&2 cd "$directory"
IFS=$'\n' tar c $files #shellcheck disable=SC2086
IFS="$newline_str" tar c $files
) )

View file

@ -2,8 +2,11 @@
set -e set -e
# shellcheck disable=SC2153
directory="${DIRECTORY}" directory="${DIRECTORY}"
# shellcheck disable=SC2153
workdir="${WORKDIR}" workdir="${WORKDIR}"
# shellcheck disable=SC2153
extract="${EXTRACT}" extract="${EXTRACT}"
( (
if "$extract"; then if "$extract"; then