Correction de bug #4
This commit is contained in:
parent
116a661e42
commit
d8477dd7d3
@ -90,27 +90,56 @@ public class CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isCircular){
|
if (isCircular){
|
||||||
if (!silent && displayLines != null && !displayLines.isEmpty()) {
|
if (!silent && displayLines != null && !displayLines.isEmpty()) {
|
||||||
// Afficher les lignes formatées
|
boolean isFirstLine = true;
|
||||||
for (String line : displayLines) {
|
for (String line : displayLines) {
|
||||||
System.out.println(line);
|
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
|
// On n'exécute que si nécessaire
|
||||||
if (ruleNeedsUpdate) {
|
if (ruleNeedsUpdate) {
|
||||||
try {
|
try {
|
||||||
if(!isCircular && !silent){
|
if(!isCircular && !silent){
|
||||||
// Afficher les lignes formatées
|
// Afficher les lignes formatées avec traitement spécial pour les continuations
|
||||||
if (displayLines != null && !displayLines.isEmpty()) {
|
if (displayLines != null && !displayLines.isEmpty()) {
|
||||||
for (String line : displayLines) {
|
boolean isFirstLine = true;
|
||||||
System.out.println(line);
|
|
||||||
}
|
for (String line : displayLines) {
|
||||||
} else {
|
if (isFirstLine) {
|
||||||
System.out.println(command);
|
// 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);
|
if (debug) System.out.println("Debug: Executing " + actualCommand);
|
||||||
ProcessBuilder pb = new ProcessBuilder("sh", "-c", actualCommand);
|
ProcessBuilder pb = new ProcessBuilder("sh", "-c", actualCommand);
|
||||||
pb.inheritIO();
|
pb.inheritIO();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user