Skip to content

Instantly share code, notes, and snippets.

View koehn's full-sized avatar
🧐
Coaching

Brad Koehn koehn

🧐
Coaching
View GitHub Profile
@andkirby
andkirby / semversort.sh
Last active January 12, 2024 15:28
Semantic versions sorting in bash.
#!/usr/bin/env bash
# Download this gist
# curl -Ls https://gist.github.com/andkirby/54204328823febad9d34422427b1937b/raw/semversort.sh | bash
# And run:
# $ semversort 1.0 1.0-rc 1.0-patch 1.0-alpha
# or in GIT
# $ semversort $(git tag)
# Using pipeline:
# $ echo 1.0 1.0-rc 1.0-patch 1.0-alpha | semversort
#