diff --git a/src/fr/monlouyan/bakefile/CommandExecutor.java b/src/fr/monlouyan/bakefile/CommandExecutor.java index 5aeaa02..a4d6261 100644 --- a/src/fr/monlouyan/bakefile/CommandExecutor.java +++ b/src/fr/monlouyan/bakefile/CommandExecutor.java @@ -71,18 +71,25 @@ public class CommandExecutor { } for (String command : rule.getCommands()) { + // Vérifier si la commande commence par @ (ne pas afficher la commande) + boolean silent = command.startsWith("@"); + // Enlever le @ si présent pour exécuter la commande correctement + String actualCommand = silent ? command.substring(1) : command; + if (isCircular){ - System.out.println(command); + if (!silent) { + System.out.println(actualCommand); + } } // On n'exécute que si nécessaire if (ruleNeedsUpdate) { try { - if(!isCircular){ - System.out.println(command); + if(!isCircular && !silent){ + System.out.println(actualCommand); } - if (debug) System.out.println("Debug: Executing " + command); - ProcessBuilder pb = new ProcessBuilder("sh", "-c", command); + if (debug) System.out.println("Debug: Executing " + actualCommand); + ProcessBuilder pb = new ProcessBuilder("sh", "-c", actualCommand); pb.inheritIO(); Process process = pb.start();