Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use exe-relative paths instead of ~/.payment/#22

Merged
juntao merged 6 commits intomainfrom
use-exe-relative-paths
Feb 13, 2026
Merged

Use exe-relative paths instead of ~/.payment/#22
juntao merged 6 commits intomainfrom
use-exe-relative-paths

Conversation

@juntao
Copy link
Member

@juntao juntao commented Feb 13, 2026

Summary

  • All tools now resolve wallet.json, password.txt, and config.toml relative to the executable binary location using std::env::current_exe(), instead of hardcoding ~/.payment/
  • Removed dirs crate dependency — paths are determined by going up two levels from the binary (scripts/ → skill root)
  • Updated all documentation (README, crate READMEs, PLAN.md, install.md, config-default.toml) to remove every ~/.payment reference

Test plan

  • cargo fmt --all — clean
  • cargo clippy --all — clean
  • cargo test --all — all 8 tests pass
  • grep -r "~/.payment" — zero matches across entire codebase

🤖 Generated with Claude Code

Michael Yuan and others added 6 commits February 13, 2026 11:53
All tools now resolve wallet.json, password.txt, and config.toml
relative to the executable binary location using std::env::current_exe(),
instead of hardcoding ~/.payment/. This makes the skill fully portable
and self-contained within its installation directory.

- Replace dirs::home_dir() with current_exe()-based path resolution
- Remove dirs crate dependency
- Update config defaults to use relative filenames (wallet.json, password.txt)
- Replace expand_tilde() with resolve_path() for relative/absolute handling
- Remove x402curl from workspace (directory already deleted)
- Update all documentation to reflect new path convention

Signed-off-by: Michael Yuan <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Rename skill/ directory to skills/payment/ to match new path convention
- Remove old skill/config-default.toml and skill/install.md (replaced by
  files already in skills/payment/)
- Remove x402curl/ placeholder crate (already removed from workspace)

Signed-off-by: Michael Yuan <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
The exe_dir() function returns the directory containing the binary
(scripts/). All default paths use ../ prefix to reach the skill root:
  ../wallet.json, ../password.txt, ../config.toml

This matches the intended mental model: paths are relative to the
executable binary location.

Signed-off-by: Michael Yuan <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Update README skill directory structure from skill/ to skills/payment/
- Update final installed structure to show wallet.json, config.toml layout
- Remove x402curl from workspace crates table (crate was removed)
- Fix CI workflow reference from release.yml to ci.yml
- Remove x402curl from CI packaging, verification steps
- Remove x402curl reference from create-wallet README

Signed-off-by: Michael Yuan <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Tests the end-to-end flow on Linux:
1. Set up skill directory layout with binaries in scripts/
2. Create wallet and verify address format
3. Get address via get-address and verify JSON output
4. Create a 0.01 USDC payment link via x402labs API
5. Verify payment status is unpaid

Signed-off-by: Michael Yuan <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
@juntao juntao merged commit 2800d36 into main Feb 13, 2026
12 checks passed
@juntao juntao deleted the use-exe-relative-paths branch February 13, 2026 20:12
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