supitsdu / clipper

Seamlessly copy file contents to clipboard from command line. Lightweight, cross-platform tool for instant text transfers.
MIT License
3 stars 3 forks source link

Improve Version Management to Distinguish Between Development and Production Builds #36

Closed supitsdu closed 4 months ago

supitsdu commented 4 months ago

Currently, Clipper relies solely on Git tags to determine the version displayed using the -v flag. While this works well for production builds, it's not ideal for development environments where the codebase might not always be tagged.

This enhancement aims to provide a more informative and user-friendly approach to version management.

Proposed Changes:

  1. Development Version:
    • Introduce a default "dev" version string (e.g., "v0.0.0-dev") that is displayed when the code is run directly without being built (e.g., go run main.go).
    • Consider appending a timestamp or commit hash to the "dev" version for precise track of development builds.
  2. Build Version:
    • During the build process, continue using Git tags to determine the version if available.
    • If no tag is found, use a fallback version string (e.g., "v0.0.0-unreleased") to indicate that the build is not associated with a specific release.
  3. Display Logic:
    • Refactor the code to conditionally display the appropriate version based on whether the tool is running from a built binary or in development mode.

Goals:

Additional Considerations: