Improve osgi-install
authorMathieu Baudier <mbaudier@argeo.org>
Tue, 23 May 2023 09:36:32 +0000 (11:36 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Tue, 23 May 2023 09:36:32 +0000 (11:36 +0200)
src/org/argeo/build/Make.java

index a9676f86d8ac05ccb6487c1e69cb77cb061f2ef7..33291b20ba05289043ba7aab26ede874ba6391a3 100644 (file)
@@ -354,6 +354,9 @@ public class Make {
                        if (uninstall) { // uninstall
                                if (Files.exists(targetJarP)) {
                                        Files.delete(targetJarP);
+                                       Path targetParent = targetJarP.getParent();
+                                       if (!Files.list(targetParent).iterator().hasNext())
+                                               Files.delete(targetParent);
                                        logger.log(DEBUG, "Removed " + targetJarP);
                                        count++;
                                }
@@ -362,6 +365,7 @@ public class Make {
                                boolean update = Files.exists(targetJarP);
                                Files.copy(jarP, targetJarP);
                                logger.log(DEBUG, (update ? "Updated " : "Installed ") + targetJarP);
+                               count++;
                        }
                }
                logger.log(INFO, uninstall ? count + " bundles removed" : count + " bundles installed or updated");