Onset: version control where nobody waits and nothing gets lost. The on command, its core and onset-server.
| VERSION=$1 |
| 6 | DIR=$2 |
| 7 | BASE=${ONSET_DOWNLOADS:-https://downloads.coline.dev/onset} |
| 8 | sha() { sha256sum "$DIR/onset-$VERSION-$1.tar.gz" | cut -d' ' -f1; } |
| 9 | block() { # platform |
| 10 | printf ' url "%s/%s/onset-%s-%s.tar.gz"\n sha256 "%s"\n' "$BASE" "$VERSION" "$VERSION" "$1" "$(sha "$1")" |
| 11 | } |
| 12 | cat <<EOF |
| 13 | class Onset < Formula |
| 14 | desc "Version control where nobody waits and nothing gets lost" |
| 15 | homepage "https://upstream.codes/onset" |
| 16 | version "$VERSION" |
| 17 | license "Apache-2.0" |
| 18 |
| 19 | on_macos do |
| 20 | on_arm do |
| 21 | $(block darwin-arm64) |
| 22 | end |
| 23 | on_intel do |
| 24 | $(block darwin-x64) |
| 25 | end |
| 26 | end |
| 27 |
| 28 | on_linux do |
| 29 | on_arm do |
| 30 | $(block linux-arm64) |
| 31 | end |
| 32 | on_intel do |
| 33 | $(block linux-x64) |
| 34 | end |
| 35 | end |
| 36 |
| 37 | def install |
| 38 | bin.install "on" |
| 39 | bin.install "onset-server" if File.exist?("onset-server") |
| 40 | generate_completions_from_executable(bin/"on", "completions") |
| 41 | end |
| 42 |
| 43 | test do |
| 44 | assert_match version.to_s, shell_output("#{bin}/on --version") |
| 45 | end |
| 46 | end |
| 47 | EOF |
| 48 |