Skip to content

fix: expand ~ in CLI and bulk-scan wizard path arguments - #143

Closed
mangeshraut712 wants to merge 1 commit into
openai:mainfrom
mangeshraut712:fix/cli-tilde-path-expansion
Closed

fix: expand ~ in CLI and bulk-scan wizard path arguments#143
mangeshraut712 wants to merge 1 commit into
openai:mainfrom
mangeshraut712:fix/cli-tilde-path-expansion

Conversation

@mangeshraut712

@mangeshraut712 mangeshraut712 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes ~ in CLI path arguments is not expanded outside of scan #57: expand ~, ~/..., and ~\... for path-typed CLI inputs outside scan (bulk-scan CSV/--output-dir, export scan/output/source-root, scans list repository/--scan-root, install-hook repository, and the bulk-scan wizard output prompt).
  • Reuses existing expandHome via a shared resolveCliPath helper; leaves non-path validate inputs and export --output - unchanged.
  • Prefer HOME / USERPROFILE when expanding so Windows and isolated tests behave consistently.
  • Builds on the approach from closed PR cli path & tilde expansion #55 / @Dheerajsom's investigation.

Test plan

  • Wizard prompt returns ~/custom-results → home-relative output, no <cwd>/~
  • bulk-scan ~/repositories.csv --output-dir ~/security-scans from another cwd
  • GitHub Actions on this PR

@chatgpt-codex-connector

Copy link
Copy Markdown

Note

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@mangeshraut712
mangeshraut712 force-pushed the fix/cli-tilde-path-expansion branch from 9de7b67 to 8f5d899 Compare July 30, 2026 17:21
scan already expanded home-relative paths, but bulk-scan, export, scans
list, install-hook, and the interactive wizard resolved paths with bare
resolve(), so ~/... became a literal directory named ~. Share expandHome
via resolveCliPath across those entry points. Prefer HOME/USERPROFILE
with bracket access for TypeScript index-signature compliance.

Fixes #57
@mangeshraut712
mangeshraut712 force-pushed the fix/cli-tilde-path-expansion branch from 8f5d899 to 6811302 Compare July 30, 2026 17:28
@mangeshraut712 mangeshraut712 closed this by deleting the head repository Aug 1, 2026
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.

~ in CLI path arguments is not expanded outside of scan

1 participant