Use exe-relative paths instead of ~/.payment/#22
Merged
Conversation
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]>
…able" This reverts commit dc6bc17.
- 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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wallet.json,password.txt, andconfig.tomlrelative to the executable binary location usingstd::env::current_exe(), instead of hardcoding~/.payment/dirscrate dependency — paths are determined by going up two levels from the binary (scripts/→ skill root)~/.paymentreferenceTest plan
cargo fmt --all— cleancargo clippy --all— cleancargo test --all— all 8 tests passgrep -r "~/.payment"— zero matches across entire codebase🤖 Generated with Claude Code