WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@aarlint
Copy link
Collaborator

@aarlint aarlint commented Oct 23, 2025

This commit fixes two issues with the CLI's get command:

  1. URL parsing now supports optional file paths (e.g., /e/{id}/filename.txt)

  2. Fixed CLI process hanging after successful retrieval

    • Added process.exit(0) after content output
    • Prevents analytics setInterval timer from keeping process alive
    • Commands now exit cleanly after completion
  3. Fixed decryption output property access

    • Changed from result.content to result.decryptedContent || result.content
    • Handles both property naming conventions from different decryption methods

Tested with:

  • Encrypted pastes with filenames
  • GitHub user encryption (gh: prefix)
  • Full encryption/decryption workflow
  • All commands now exit properly

🤖 Generated with Claude Code

This commit fixes two issues with the CLI's get command:

1. URL parsing now supports optional file paths (e.g., /e/{id}/filename.txt)
   - Updated regex patterns to match URLs with optional filenames
   - Preserves full pathname when constructing fetch URLs
   - Enables retrieval of pastes with filenames like https://paste.d3d.dev/e/jbcpXnCw/README.md

2. Fixed CLI process hanging after successful retrieval
   - Added process.exit(0) after content output
   - Prevents analytics setInterval timer from keeping process alive
   - Commands now exit cleanly after completion

3. Fixed decryption output property access
   - Changed from result.content to result.decryptedContent || result.content
   - Handles both property naming conventions from different decryption methods

Tested with:
- Encrypted pastes with filenames
- GitHub user encryption (gh: prefix)
- Full encryption/decryption workflow
- All commands now exit properly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@anoncam anoncam merged commit 7064a2f into main Nov 13, 2025
3 checks passed
@anoncam anoncam deleted the fix/cli-url-parsing-and-process-exit branch November 13, 2025 17:09
github-actions bot added a commit that referenced this pull request Nov 13, 2025
Version bump type: patch
PR: #100
Title: fix: support file paths in paste URLs and fix CLI hanging
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.

3 participants