Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script_path / script_dir improvements #375

Merged
merged 3 commits into from
Dec 4, 2024
Merged

script_path / script_dir improvements #375

merged 3 commits into from
Dec 4, 2024

Conversation

irh
Copy link
Contributor

@irh irh commented Dec 4, 2024

This PR updates koto.script_path/script_dir so that they're functions that always return the correct results, irrespective of the module that they're called from.

Koto::set_script_path has been removed, and the compile/compile_and_run functions now take a CompileArgs struct that optionally includes the script path.

@irh irh force-pushed the script-path-improvements branch from 18d0965 to e361ddf Compare December 4, 2024 07:46
irh added 2 commits December 4, 2024 09:34
The existing approach of relying on the client to set the script path
is brittle, and simply doesn't work for imported modules.

A better approach is to defer to the path that's already stored in the
Chunk, which works as expected for any module.
@irh irh force-pushed the script-path-improvements branch from e361ddf to b7bf074 Compare December 4, 2024 08:34
@irh irh merged commit 86d7922 into main Dec 4, 2024
8 checks passed
@irh irh deleted the script-path-improvements branch December 4, 2024 08:59
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.

1 participant