mirror of
https://github.com/processing/processing4.git
synced 2026-02-21 22:35:36 +01:00
clean up added code
This commit is contained in:
@@ -181,8 +181,8 @@ public class Commander implements RunnerListener {
|
||||
// preferencesPath = arg.substring(preferencesArg.length());
|
||||
|
||||
} else if (arg.startsWith(outputArg)) {
|
||||
outputPath = arg.substring(outputArg.length());
|
||||
outputSet = true;
|
||||
outputPath = arg.substring(outputArg.length());
|
||||
|
||||
} else if (arg.equals(forceArg)) {
|
||||
force = true;
|
||||
@@ -204,35 +204,21 @@ public class Commander implements RunnerListener {
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
if (outputPath == null && outputSet) {
|
||||
complainAndQuit("An output path must be specified.", true);
|
||||
}
|
||||
|
||||
if(outputSet){
|
||||
if (outputSet) {
|
||||
if (outputPath == null) {
|
||||
complainAndQuit("An output path must be specified.", true);
|
||||
}
|
||||
|
||||
outputFolder = new File(outputPath);
|
||||
if (outputFolder.exists()) {
|
||||
if (force) {
|
||||
Base.removeDir(outputFolder);
|
||||
} else {
|
||||
complainAndQuit("The output folder already exists. " +
|
||||
"Use --force to remove it.", false);
|
||||
"Use --force to remove it.", false);
|
||||
}
|
||||
}
|
||||
}/*else{
|
||||
System.out.println("try to make temp folder...");
|
||||
try {
|
||||
System.out.println(sketch.getName());
|
||||
File buildFolder = Base.createTempFolder(sketch.getName(), "temp", null);
|
||||
outputFolder = buildFolder;
|
||||
} catch (IOException e) {
|
||||
Base.showWarning("Build folder bad",
|
||||
"Could not find a place to build the sketch.", e);
|
||||
}
|
||||
//outputFolder = sketch.makeTempFolder();
|
||||
System.out.println("made temp folder");
|
||||
}*/
|
||||
|
||||
if (outputSet){
|
||||
|
||||
if(!outputFolder.mkdirs()) {
|
||||
complainAndQuit("Could not create the output folder.", false);
|
||||
}
|
||||
@@ -250,8 +236,8 @@ public class Commander implements RunnerListener {
|
||||
if (sketchPath == null) {
|
||||
complainAndQuit("No sketch path specified.", true);
|
||||
|
||||
} else if (outputSet){
|
||||
if(outputPath.equals(sketchPath)) {
|
||||
} else if (outputSet) {
|
||||
if (outputPath.equals(sketchPath)) {
|
||||
complainAndQuit("The sketch path and output path cannot be identical.", false);
|
||||
}
|
||||
|
||||
@@ -269,8 +255,9 @@ public class Commander implements RunnerListener {
|
||||
try {
|
||||
sketch = new Sketch(pdePath, javaMode);
|
||||
|
||||
if(!outputSet)
|
||||
if (!outputSet) {
|
||||
outputFolder = sketch.makeTempFolder();
|
||||
}
|
||||
|
||||
if (task == BUILD || task == RUN || task == PRESENT) {
|
||||
JavaBuild build = new JavaBuild(sketch);
|
||||
|
||||
Reference in New Issue
Block a user