You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regarding the change to cmdline. While I think relative to script directory is the far more desirable behavior, this is a problem because it will break some cmdline scripts (which is why I haven't moved on this myself). However, it occurred to me that we could add another script execution CommandLineTool or even a command argument that forces it to use the relative path behavior, keeping the current working directory behavior for existing cmdline scripts, since this can still be useful in some contexts.
It would be nice to inventory various other languages. What does bash and powershell do? What about languages like python and node/js, which are often used as scripting languages? Having that inventory would be interesting, it may or may not influence anything, but perhaps that would reveal new options.
For instance, in powershell, if you do "$PSScriptRoot", that's the parent folder of the currently running script. I'm not sure what "." means though, I would assume that's the cwd, which may or may not be the same as the current executing script, but that's for sure ambiguous in a way that $PSScriptRoot isn't. Bash has several options: https://stackoverflow.com/questions/35006457/choosing-between-0-and-bash-source
In general in cmdline, there are 4 interesting defaults I can imagine: current file's directory, cwd, and directory the initial script was called from, directory the script was initially trigger from (i.e. cwd() at program start). It seems like different languages cover some of these options, but not others, and really only shell languages tend to have the concept of cwd anyways.
In any case, I think having a cmdline switch to determine "." behavior is fine, since we have options to disambiguate in all of the mentioned cases:
Depending on the needs of the script, any of these options could be used to disambiguate, but need a different default depending on the context can be modified via the cmdline switch.
This topic was discussed on Discord, this issue serves the purpose of not losing the results.
Desired behavior
cd()
as base directory.cd()
at definition time for all calls to that procedure.The text was updated successfully, but these errors were encountered: