premake-core icon indicating copy to clipboard operation
premake-core copied to clipboard

Running `./premake5 --help` in a directory with corrupted premake5.lua will only show error

Open mercury233 opened this issue 3 years ago • 3 comments

Before opening a new bug report, please read Reporting Bugs and consider if this is something you can contribute yourself. If this a new bug, help us help you by filling in the template below.

What seems to be the problem? Running ./premake5 --help in a directory with corrupted premake5.lua will only show error.

What did you expect to happen? premake5 --help show warning, ignore the premake5.lua file, and show other help information.

What have you tried so far? Delete or rename bad premake5.lua.

How can we reproduce this?

mkdir test-premake
cd test-premake
cp /whatever/path/to/premake5.exe .
./premake5 --help
echo aaaaa > premake5.lua
./premake5 --help

What version of Premake are you using? ~~Error: F:/Works/test-premake/premake5.lua:2: syntax error near ~~

Anything else we should know?

mercury233 avatar Sep 28 '22 07:09 mercury233

premake5.lua might add extra options to the help (extra command lines, extra modules, ...), so to be accurate, executable has to read the file.

Jarod42 avatar Sep 29 '22 11:09 Jarod42

@Jarod42 I think it should show other help information if failed to parse the premake5.lua file

mercury233 avatar Sep 29 '22 14:09 mercury233

Changing from bug to enhancement. One of the implicit prerequisites to Premake is valid input. If the input isn't valid, we do not currently ensure a defined behavior.

nickclark2016 avatar Sep 29 '22 15:09 nickclark2016