Skip to content

Commit

Permalink
add homebrew support
Browse files Browse the repository at this point in the history
  • Loading branch information
jfding committed Oct 26, 2024
1 parent 2ccaf04 commit dc31812
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions HomebrewFormula
30 changes: 30 additions & 0 deletions pkg/brew/todor-bin.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
class TodorBin < Formula
version 'v1.10.0'
desc "todor - yet another cli TODO in Rust"
homepage "https://github.com/jfding/todor"

on_macos do
on_intel do
url "https://github.com/jfding/todor/releases/download/#{version}/todor-x86_64-apple-darwin.zip"
sha256 "69aaff12164c7a0076836f8de6feac445232e48919a5f1c4272d31e042dc5b2e"
end
on_arm do
url "https://github.com/jfding/todor/releases/download/#{version}/todor-aarch64-apple-darwin.zip"
sha256 "a8713e804cc2f190119dd99a482af9254a088613ed1ea0ff55655ba7e98acf0d"
end
end
on_linux do
on_intel do
url "https://github.com/jfding/todor/releases/download/#{version}/todor-x86_64-unknown-linux-musl.zip"
sha256 "7848dc9d17e644f7496a9232d589628e0e4cf8f506dc8927a5404986816ecf34"
end
on_arm do
url "https://github.com/jfding/todor/releases/download/#{version}/todor-aarch64-unknown-linux-musl.zip"
sha256 "6df8410f2e7a39716a0e5397ca649341628459957b38d6f53379368790ba5be4"
end
end

def install
bin.install "todor"
end
end
20 changes: 20 additions & 0 deletions scripts/sha256-releases
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

[[ -z $1 ]] && { echo "Usage: $(basename $0) <version>"; exit 1 }
version="$1"

# Linux and Darwin builds.
for arch in aarch64 x86_64; do
for target in apple-darwin unknown-linux-musl; do
url="https://github.com/jfding/todor/releases/download/$version/todor-$arch-$target.zip"
sha=$(curl -sfSL "$url" | sha256sum)
echo "$version-$arch-$target $sha"
done
done

# Source.
for ext in zip tar.gz; do
url="https://github.com/jfding/todor/archive/refs/tags/$version.$ext"
sha=$(curl -sfSL "$url" | sha256sum)
echo "source.$ext $sha"
done

0 comments on commit dc31812

Please sign in to comment.