From 5c78b8471b675c76a283deb4c861f89d1f18fbd3 Mon Sep 17 00:00:00 2001 From: "Helmut K. C. Tessarek" Date: Thu, 26 Apr 2018 07:52:09 -0400 Subject: [PATCH] Improve installto.sh (follow-up to PR #6261) (#6263) If the contents `file` and `file.new` are the same, `file.new` should be removed. --- bin/installto.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/installto.sh b/bin/installto.sh index caa7a9cee..ab080dc9a 100755 --- a/bin/installto.sh +++ b/bin/installto.sh @@ -88,6 +88,9 @@ if (strtolower($input) == 'y') { if (file_get_contents("$target_dir/$file.new") != file_get_contents("$target_dir/$file")) { echo "\n!! New $file file saved as $file.new !!"; } + else { + @unlink("$target_dir/$file.new"); + } } }