Skip to content

fix(test): resolve relative paths against cwd in file test operators#297

Merged
chaliy merged 2 commits intomainfrom
claude/issue-291-file-test-cwd-76a2F
Feb 26, 2026
Merged

fix(test): resolve relative paths against cwd in file test operators#297
chaliy merged 2 commits intomainfrom
claude/issue-291-file-test-cwd-76a2F

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Feb 26, 2026

Summary

  • test/[ builtin and [[ ]] conditional now resolve relative file paths against cwd
  • Previously [ -f test.txt ] always looked at /test.txt regardless of cd
  • Both evaluate_unary and evaluate_binary (file ops) use resolve_file_path(cwd, arg)
  • [[ ]] handler in interpreter uses same pattern

Test plan

  • issue_291_file_test_after_cd_in_scriptcd /project; /check.sh with [ -f test.txt ]
  • issue_291_double_bracket_file_test_after_cdcd /mydir; [[ -f data.json ]]

Closes #291

@chaliy chaliy merged commit 598187f into main Feb 26, 2026
16 checks passed
@chaliy chaliy deleted the claude/issue-291-file-test-cwd-76a2F branch March 12, 2026 03:41
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.

bug: [ -f ] doesn't see VFS files after cd in script execution

2 participants