From cdd63022814cc5a319234c6d00e740a2e763ab16 Mon Sep 17 00:00:00 2001 From: Andrew Berry Date: Mon, 23 Sep 2024 09:09:21 -0400 Subject: [PATCH] Fix creating archives in the temporary directory and not the cwd (#693) --- tasks/snapshot.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasks/snapshot.yml b/tasks/snapshot.yml index 1df44757..176ffa36 100644 --- a/tasks/snapshot.yml +++ b/tasks/snapshot.yml @@ -57,6 +57,7 @@ tasks: TMP_DIR=$(mktemp -d) cp -Rp . $TMP_DIR if [ ! -f ".drainpipeignore" ]; then echo ".drainpipeignore does not exist" && touch $TMP_DIR/.drainpipeignore; fi + DESTINATION=$(realpath {{ .o }}) cd $TMP_DIR {{ .PREPARE_DIRECTORY }} git config user.email 'no-reply@lullabot.com' @@ -64,5 +65,5 @@ tasks: git commit --quiet --message "Initial commit" --no-gpg-sign git config tar.tar.xz.command "xz -c" git config tar.tar.bz2.command "bzip2 -c" - git archive -o {{.o}} HEAD - test -f {{.o}} + git -C $TMP_DIR archive -o "$DESTINATION" HEAD + test -f "$DESTINATION"