fix that --update overwrites .mk files - fixes #505 default tip

Tue, 12 Nov 2024 17:11:55 +0100

author
Mike Becker <universe@uap-core.de>
date
Tue, 12 Nov 2024 17:11:55 +0100
changeset 124
a93fe3c0b916
parent 123
d89b75fdf0aa

fix that --update overwrites .mk files - fixes #505

src/main/java/de/unixwork/uwproj/Main.java file | annotate | diff | comparison | revisions
--- a/src/main/java/de/unixwork/uwproj/Main.java	Tue Nov 12 17:00:51 2024 +0100
+++ b/src/main/java/de/unixwork/uwproj/Main.java	Tue Nov 12 17:11:55 2024 +0100
@@ -91,7 +91,9 @@
         System.err.printf("                         (default: %s)\n", IN_FILE_DEFAULT);
         System.err.println("  -t --template <file>   Path to the velocity template");
         System.err.printf("                         (default: %s)\n", TPL_FILE_DEFAULT);
-        System.err.println("     --update            Same as --init, but overwrites existing files");
+        System.err.println("     --update            Updates configure template and toolchain detection");
+        System.err.println("                         in directory 'make' to current version.");
+        System.err.println("                         You might need to update project.xml manually.");
     }
 
     private static void extract(Path path) {
@@ -104,7 +106,9 @@
     }
 
     private static void init(boolean force) {
-        final var files = new String[]{
+        final var files = force ? new String[] {
+                "configure.vm", "toolchain.sh", "uwproj.xsd"
+        } : new String[]{
                 "cc.mk", "gcc.mk", "clang.mk", "suncc.mk",
                 "configure.vm", "toolchain.sh", "uwproj.xsd"
         };

mercurial