Skip to content

Expand Local tilde site paths for default macOS installs - #18

Open
nicolabiagioni wants to merge 1 commit into
soderlind:mainfrom
nicolabiagioni:fix/expand-local-tilde-paths
Open

Expand Local tilde site paths for default macOS installs#18
nicolabiagioni wants to merge 1 commit into
soderlind:mainfrom
nicolabiagioni:fix/expand-local-tilde-paths

Conversation

@nicolabiagioni

Copy link
Copy Markdown

Summary

  • Local's default macOS sites.json stores site directories as ~/Local Sites/<name>. The wrappers compared CWD and passed --path against that string without expanding the tilde, so auto-detect failed and WP-CLI looked for a literal ~/... folder.
  • Expand those paths (and the same logic in wp-pcp-local / setup-direnv) before matching or invoking WP-CLI.
  • Verified on a stock Local install: wp --list prints absolute paths, auto-detect from ~/Local Sites/sm and --site=sm both return wp core version.

Test plan

  • python3 skills/wp-cli-local/scripts/test_local_paths.py
  • bash skills/wp-cli-local/scripts/wp --list shows expanded paths, not ~/Local Sites/...
  • From inside a default Local site directory, bash skills/wp-cli-local/scripts/wp core version auto-detects
  • From elsewhere, bash skills/wp-cli-local/scripts/wp --site=<name> core version works
  • node scripts/build-agent-plugin.mjs --check

Made with Cursor

Local stores ~/Local Sites/... in sites.json. Matching and WP-CLI --path
used that string as a filesystem path, which broke auto-detect and the
wrapper on stock Local setups.

Co-authored-by: Cursor <cursoragent@cursor.com>
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