feat(interpreter): support executing script files by path#222
Merged
Conversation
Add script execution by absolute/relative path and $PATH search. Previously, `/path/to/script.sh` returned "command not found" (exit 127) instead of executing the script. Changes: - Extract try_execute_script_by_path() for path-based dispatch with proper error handling: stat → dir check → perm check → read → execute - Extract try_execute_script_via_path_search() for $PATH lookup - Extract execute_script_content() shared helper: strips shebang, pushes call frame ($0, $1..N), parses, executes - Fix monty dependency version (0.0.6 → 0.0.7) - Update specs and docs Closes: script execution by path issue https://claude.ai/code/session_017ATUwPtZ4y542dF4tn9wRU
Bump exemption versions for: anyhow, bumpalo, clap, clap_builder, security-framework, security-framework-sys, syn. https://claude.ai/code/session_017ATUwPtZ4y542dF4tn9wRU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
$PATHsearch in the interpreter dispatch chain$0,$1..N), error handling for missing files (exit 127), directories (exit 126), and permission denied (exit 126)$PATHsearch for commands without/— searches each$PATHdirectory for executable files after builtins check0.0.6→0.0.7, preexisting build breakage)Test plan
script_execution_tests.rs): absolute path, relative path, args,$0/$#/$@, missing file, directory, permission denied, exit code propagation, nested paths,$PATHsearch, nested script calls, chmod+execscript-exec.test.sh): end-to-end bash behavior verificationeval-bugs.test.shscript_chmod_exec_by_pathcase)cargo fmt --checkcleancargo clippy -- -D warningsclean