Skip to content

Conversation

skools-here
Copy link

This PR fixes issue [#1219]

Where the Processing CLI failed to run sketches when the main .pde file had been renamed (e.g. main.pde) and specified in sketch.properties.

Changes Made

Updated findMain() in Sketch.java:

If sketch.properties defines a main file and it exists → return it immediately.

If it does not exist → log a warning and fall back to the default .pde.

If neither exists → return null (current error behavior preserved).

@Stefterv
Copy link
Collaborator

Stefterv commented Sep 9, 2025

Hi @skools-here, thank you for your efforts! I just tested it locally and the issue is still there. Could you give it a try on your side and update the fix?

@Stefterv
Copy link
Collaborator

Stefterv commented Sep 9, 2025

As part of your work could you please also add a test to https://github.com/processing/processing4/blob/main/app/test/processing/app/CLITest.kt

@skools-here
Copy link
Author

Ok i am looking into this and will also add test too !

@skools-here
Copy link
Author

Hey I fixed some issues in this kindly review !

@Stefterv
Copy link
Collaborator

Hi @skools-here thank you for your effort, I quickly tested it again but still the same results, also the test does not actually test for the intended behaviour although it is heading in the right direction .
I can tell you that the offending code lives here:

File pdeFile = new File(sketchFolder, sketchFolder.getName() + ".pde");
if (!pdeFile.exists()) {
complainAndQuit("Not a valid sketch folder. " + pdeFile + " does not exist.", true);
}
pdePath = pdeFile.getAbsolutePath();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants