From: Alexander Barton Date: Thu, 20 Jul 2023 09:04:26 +0000 (+0200) Subject: ansible-boilerplate: Only create ".new" files when called with the "init" subcommand X-Git-Tag: rel-1-0-0~5 X-Git-Url: https://arthur.ath.cx/gitweb/?a=commitdiff_plain;h=1f1fce0dc7847ef87078fe473a6632f7d41bc97c;p=ansible-collection-boilerplate.git ansible-boilerplate: Only create ".new" files when called with the "init" subcommand Don't create ".new" files on "upgrade"! --- diff --git a/bin/ansible-boilerplate b/bin/ansible-boilerplate index 9d5fc21..3d089a1 100755 --- a/bin/ansible-boilerplate +++ b/bin/ansible-boilerplate @@ -261,7 +261,7 @@ Upgrade_Template() { # Do not override the target when it exists already! if [ -e "$1" ]; then # Target already exists. Is it different? - if ! cmp "$1" "${BASE_D}/$1"; then + if [ "$2" = "--init" ] && ! cmp "$1" "${BASE_D}/$1"; then # Files are not the same! Install new version in parallel: install -b -m 0644 -p -v "${BASE_D}/$1" "$1.new" fi