]> arthur.barton.de Git - ansible-collection-boilerplate.git/blobdiff - bin/ansible-boilerplate
ansible-boilerplate: Only create ".new" files when called with the "init" subcommand
[ansible-collection-boilerplate.git] / bin / ansible-boilerplate
index 9d5fc213024fb9da4adeff4bc0ea104d113595fb..3d089a189c9f1c3a0eed7dabdcb9917c740ffdf7 100755 (executable)
@@ -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