Correction de bug #4
This commit is contained in:
parent
116a661e42
commit
d8477dd7d3
@ -90,27 +90,56 @@ public class CommandExecutor {
|
||||
}
|
||||
|
||||
if (isCircular){
|
||||
if (!silent && displayLines != null && !displayLines.isEmpty()) {
|
||||
// Afficher les lignes formatées
|
||||
for (String line : displayLines) {
|
||||
System.out.println(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!silent && displayLines != null && !displayLines.isEmpty()) {
|
||||
boolean isFirstLine = true;
|
||||
for (String line : displayLines) {
|
||||
if (isFirstLine) {
|
||||
// Pour la première ligne, supprimer l'indentation
|
||||
if (line.startsWith("\t")) {
|
||||
System.out.println(line.substring(1));
|
||||
} else {
|
||||
System.out.println(line);
|
||||
}
|
||||
isFirstLine = false;
|
||||
} else {
|
||||
// Pour les lignes suivantes, conserver l'indentation
|
||||
System.out.println(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// On n'exécute que si nécessaire
|
||||
if (ruleNeedsUpdate) {
|
||||
try {
|
||||
if(!isCircular && !silent){
|
||||
// Afficher les lignes formatées
|
||||
if (displayLines != null && !displayLines.isEmpty()) {
|
||||
for (String line : displayLines) {
|
||||
System.out.println(line);
|
||||
}
|
||||
} else {
|
||||
System.out.println(command);
|
||||
}
|
||||
}
|
||||
// Afficher les lignes formatées avec traitement spécial pour les continuations
|
||||
if (displayLines != null && !displayLines.isEmpty()) {
|
||||
boolean isFirstLine = true;
|
||||
|
||||
for (String line : displayLines) {
|
||||
if (isFirstLine) {
|
||||
// Pour la première ligne, toujours supprimer l'indentation
|
||||
if (line.startsWith("\t")) {
|
||||
System.out.println(line.substring(1));
|
||||
} else {
|
||||
System.out.println(line);
|
||||
}
|
||||
isFirstLine = false;
|
||||
} else {
|
||||
// Pour les lignes suivantes d'une continuation, conserver l'indentation
|
||||
System.out.println(line);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Cas d'une commande simple (une seule ligne)
|
||||
if (command.startsWith("\t")) {
|
||||
System.out.println(command.substring(1));
|
||||
} else {
|
||||
System.out.println(command);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (debug) System.out.println("Debug: Executing " + actualCommand);
|
||||
ProcessBuilder pb = new ProcessBuilder("sh", "-c", actualCommand);
|
||||
pb.inheritIO();
|
||||
|
Loading…
x
Reference in New Issue
Block a user