Very often we have bad error messages (see #204) because we don't know where the lib/ folder is.
The thing is, some user will have the ARKSCRIPT_PATH pointing to a folder where the lib/ is. Some other will want to feed the lib directory path through [-L|--lib path], that's fine. But for the ones who have a unique lib/ in the working directory, they either need to setup the environment variable or feed it to the --lib and that's annoying because you just have an error "couldn't load x" or "couldn't find file bla.ark".
We should first look for the ARKSCRIPT_PATH environment variable, then look in the provided --lib option, if any, and finally look in the working directory.
What needs to be modified:
- State (maybe)
- Parser (for sure)
- VM (for sure)
Very often we have bad error messages (see #204) because we don't know where the
lib/folder is.The thing is, some user will have the
ARKSCRIPT_PATHpointing to a folder where thelib/is. Some other will want to feed the lib directory path through[-L|--lib path], that's fine. But for the ones who have a uniquelib/in the working directory, they either need to setup the environment variable or feed it to the--liband that's annoying because you just have an error "couldn't load x" or "couldn't find file bla.ark".We should first look for the ARKSCRIPT_PATH environment variable, then look in the provided
--liboption, if any, and finally look in the working directory.What needs to be modified: