From 91ceada080c26e9a16836b8fc7dfb4d959a09f6c Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Wed, 22 Jan 2020 18:18:39 +0100 Subject: [PATCH] fix: incorrect logic that prevented file to be copied if already present and different Signed-off-by: Valentin Lab --- src/install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/install.sh b/src/install.sh index b4a2f37..583b2ea 100755 --- a/src/install.sh +++ b/src/install.sh @@ -140,12 +140,12 @@ install_file() { mv -v "${path}" "$candidate" || return 1 else info "File '$path' exists and is already with the right content." + rm -f "$tmpfile" + return fi - else - echo "Creating '${path}'." - mv "${tmpfile}" "$path" || return 1 fi - rm -f "$tmpfile" + echo "Creating '${path}'." + mv "${tmpfile}" "$path" || return 1 }