Skip to content

Fix EXEs not being found in PATH on Windows#5

Merged
Wolfyxon merged 2 commits intoWolfyxon:mainfrom
VamatoHD:main
Jul 5, 2025
Merged

Fix EXEs not being found in PATH on Windows#5
Wolfyxon merged 2 commits intoWolfyxon:mainfrom
VamatoHD:main

Conversation

@VamatoHD
Copy link
Contributor

@VamatoHD VamatoHD commented Jul 4, 2025

Summary:

There was an issue where the code attempted to check if luac was a valid file by calling .is_file() on each defined path without specifying a file extension. On Windows, this would fail since file require an extension.
I've added .exe to the default software paths, ensuring the check works correctly on Windows systems.

Notes:

This fix has only been briefly tested on Windows. I'm not sure if the changes work on Unix systems.

@Wolfyxon
Copy link
Owner

Wolfyxon commented Jul 4, 2025

I'm pretty sure I got rid of actions::command_exists() and fixed this bug...

Please instead of modifying config values, in actions::parse_all():

  1. Create a root CommandRunner with luac
  2. Check if it exists (Use .exists())
  3. For each script create a new instance of it and add the right args to it. You can use .with_args()

CommandRunner::exists() has way better checking than command_exists() so it's better to replace it than modify the config values like that.

@Wolfyxon Wolfyxon changed the title Updated windows configs extension Fix luac not being found on Windows even if it's in PATH Jul 4, 2025
@VamatoHD
Copy link
Contributor Author

VamatoHD commented Jul 4, 2025

I'm not sure if that would fully resolve the issue…
The root cause lies in CommandRunner::get_path(), which is used by CommandRunner::exists(). It checks whether any path returned by CommandRunner::get_all_paths() is a file. However, this check fails because none of the generated paths include a file extension, leading to errors.

@Wolfyxon
Copy link
Owner

Wolfyxon commented Jul 4, 2025

Hm you're right, the new check is flawed too.
Although the .exe extension should be checked there instead of it being added in the config.

I'll look into this in the morning.

@Wolfyxon Wolfyxon changed the title Fix luac not being found on Windows even if it's in PATH Fix EXEs not being found in PATH on Windows Jul 5, 2025
@Wolfyxon
Copy link
Owner

Wolfyxon commented Jul 5, 2025

All good, thanks!
I'll probably publish a bugfix release today with this.

@Wolfyxon Wolfyxon merged commit 8bf15a0 into Wolfyxon:main Jul 5, 2025
1 check passed
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

Comments