Skip to content

Improve data directory resolution for development environments#30

Open
luojiyin1987 wants to merge 3 commits intosecond-state:mainfrom
luojiyin1987:fix/dev-data-dir-docs
Open

Improve data directory resolution for development environments#30
luojiyin1987 wants to merge 3 commits intosecond-state:mainfrom
luojiyin1987:fix/dev-data-dir-docs

Conversation

@luojiyin1987
Copy link

@luojiyin1987 luojiyin1987 commented Feb 21, 2026

Description

This PR improves the data directory resolution logic to better support development workflows while maintaining backward compatibility with installed skill layouts.

Key Changes

1. Environment Variable Support

  • Added PAYMENT_SKILL_DATA_DIR environment variable for explicit directory override
  • Takes precedence over all other resolution methods

2. Smarter Layout Detection

Added resolve_data_dir_from_exe() helper function that distinguishes between:

Layout Type Path Pattern Data Directory
Installed skill \u003cskill-root\u003e/scripts/\u003cbinary\u003e \u003cskill-root\u003e/
Cargo debug \u003cworkspace\u003e/target/debug/\u003cbinary\u003e Current working directory
Cargo release \u003cworkspace\u003e/target/release/\u003cbinary\u003e Current working directory
Other Any other path Executable directory

3. Updated Documentation

  • README.md: Clarified data directory resolution order
  • CLAUDE.md: Updated directory structure to remove obsolete entries

Testing

  • cargo test passes
  • cargo build --release succeeds
  • cargo clippy --all shows no warnings

Backward Compatibility

This change is fully backward compatible:

  • Existing installed skill layouts continue to work unchanged
  • No breaking changes to CLI interfaces
  • No changes to configuration file formats

Closes #29

Remove x402curl/ and update skill paths to claude/ and openclaw/
- Update data directory resolution order (env var, scripts/, cwd)
- Update license section to reference Cargo.toml MIT declaration
- Add PAYMENT_SKILL_DATA_DIR environment variable support
- Add resolve_data_dir_from_exe() helper for better layout detection
- Distinguish between installed skill layout and local cargo run
- Fall back to cwd for local development
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.

Improve data directory resolution for development environments

1 participant