KelvinShadewing / brux-gdk

Free runtime and development kit using SDL and Squirrel
GNU Affero General Public License v3.0
39 stars 20 forks source link

Fix paths provided without `./` (while also containing a subdir) resulting in an immediate exit (unmessed up PR edition) #68

Closed tulpenkiste closed 2 months ago

tulpenkiste commented 2 months ago

The issue was caused by not actually updating xygapp to reflect the chdir done immediately afterwards (e.g. build/test.nut does not exist in the build directory.

I probably didn't need to make a new PR (could have just fixed the previous one) but heyho.

KelvinShadewing commented 2 months ago

I'm not having this issue with the current unstable. Have you tested the latest build? I can open files without ./ just fine.

tulpenkiste commented 2 months ago

I'm not having this issue with the current unstable. Have you tested the latest build? I can open files without ./ just fine.

It's specifically meant to fix something like this (this example would be done in the rte dir): brux build/test.nut

This command doesn't work without the provided patch.

tulpenkiste commented 2 months ago

To make the issue more understandable:

  1. User runs brux with the arg exampledir/examplescript.nut
  2. brux detects the arg as a valid file
  3. brux cds to exampledir
  4. brux attempts to execute exampledir/examplescript.nut which fails as thats basically trying to run exampledir/exampledir/examplescript.nut if you were to not cd at all.
KelvinShadewing commented 2 months ago

Ohhhh, I see.