Description
ix text --root <workspace> --path <relative-path> resolves the path from the process working directory instead of from --root. An absolute --path outside the workspace is also accepted, so the command can search files outside the selected workspace.
Steps to reproduce
- Create
/tmp/ix-fixture/src/example.ts containing a unique term.
- Change to a different directory.
- Run
ix text <term> --root /tmp/ix-fixture --path src --format json.
- Run
ix text localhost --root /tmp/ix-fixture --path /etc --format json.
Expected behavior
Relative paths are resolved from --root. Paths that escape the selected workspace, including symlink escapes, return a structured error and a non-zero exit status.
Actual behavior
The relative path is resolved from the current directory. Absolute paths outside the workspace are searched successfully with exit status 0.
CLI output
The first command searches the wrong src directory. The second can return matches from /etc.
Environment
- OS: macOS
- Node: 22.x
- Ix version: 0.10.5 and current main (
3baa7dc)
Description
ix text --root <workspace> --path <relative-path>resolves the path from the process working directory instead of from--root. An absolute--pathoutside the workspace is also accepted, so the command can search files outside the selected workspace.Steps to reproduce
/tmp/ix-fixture/src/example.tscontaining a unique term.ix text <term> --root /tmp/ix-fixture --path src --format json.ix text localhost --root /tmp/ix-fixture --path /etc --format json.Expected behavior
Relative paths are resolved from
--root. Paths that escape the selected workspace, including symlink escapes, return a structured error and a non-zero exit status.Actual behavior
The relative path is resolved from the current directory. Absolute paths outside the workspace are searched successfully with exit status 0.
CLI output
The first command searches the wrong
srcdirectory. The second can return matches from/etc.Environment
3baa7dc)