Skip to content

Conversation

@daniel-garcia
Copy link

  • Add new 'install-to DIR' subcommand that copies the running binary to a specified directory
  • Uses atomic operations: copy to temp file, then rename for atomicity
  • Preserves executable permissions (755) from original binary
  • Handles errors gracefully with proper exit codes and cleanup
  • Validates destination directory exists and is actually a directory
  • Integrated with existing help system and command structure

Implementation details:

  • New file: internal/cli/commands_install_to.go - core functionality
  • New file: internal/cli/commands_install_to_test.go - comprehensive test suite
  • Modified: internal/cli/main.go - CLI integration and command parsing

Testing:

  • 7 test functions covering unit and integration testing
  • Tests atomic operations, error handling, permission preservation
  • Tests CLI interface, help system, and edge cases
  • All tests passing

This feature enables easy binary deployment and self-updating workflows while maintaining compatibility with upstream migrate project structure.

- Add new 'install-to DIR' subcommand that copies the running binary to a specified directory
- Uses atomic operations: copy to temp file, then rename for atomicity
- Preserves executable permissions (755) from original binary
- Handles errors gracefully with proper exit codes and cleanup
- Validates destination directory exists and is actually a directory
- Integrated with existing help system and command structure

Implementation details:
- New file: internal/cli/commands_install_to.go - core functionality
- New file: internal/cli/commands_install_to_test.go - comprehensive test suite
- Modified: internal/cli/main.go - CLI integration and command parsing

Testing:
- 7 test functions covering unit and integration testing
- Tests atomic operations, error handling, permission preservation
- Tests CLI interface, help system, and edge cases
- All tests passing

This feature enables easy binary deployment and self-updating workflows
while maintaining compatibility with upstream migrate project structure.
@daniel-garcia daniel-garcia force-pushed the ib branch 3 times, most recently from 41f3007 to 7efd19e Compare September 11, 2025 23:05
@daniel-garcia daniel-garcia merged commit c84938c into ib Sep 11, 2025
4 of 6 checks passed
@daniel-garcia daniel-garcia deleted the installTo branch September 12, 2025 01:16
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