From f2505028e7d5445261828332b33c627accb72cfe Mon Sep 17 00:00:00 2001 From: Mitchell Hanberg Date: Sun, 19 Dec 2021 18:12:17 -0500 Subject: [PATCH 1/2] zk v0.9.0 (new formula) --- Formula/zk.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Formula/zk.rb diff --git a/Formula/zk.rb b/Formula/zk.rb new file mode 100644 index 0000000000000..0b74424cb445d --- /dev/null +++ b/Formula/zk.rb @@ -0,0 +1,29 @@ +class Zk < Formula + desc "Plain text note-taking assistant" + homepage "https://github.com/mickael-menu/zk" + url "https://github.com/mickael-menu/zk/archive/refs/tags/v0.9.0.tar.gz" + sha256 "102754f2722e7e4ff0a83715085c8bfdac090b440f89020123481a95b566730f" + license "GPL-3.0-only" + + head "https://github.com/mickael-menu/zk.git", branch: "main" + + depends_on "go" => :build + + depends_on "icu4c" + uses_from_macos "sqlite" + + def install + system "go", "build", *std_go_args, "-tags", "fts5,icu", "-ldflags", "-X=main.Version=#{version} -X=main.Build=brew" + end + + test do + system "#{bin}/zk", "init", "--no-input" + system "#{bin}/zk", "index", "--no-input" + (testpath/"testnote.md").write "note content" + (testpath/"anothernote.md").write "todolist" + + output = pipe_output("#{bin}/zk list --quiet").chomp + assert_match "note content", output + assert_match "todolist", output + end +end From 94d4e61ad2133d1b6c295f3ce63d20396ead6ecd Mon Sep 17 00:00:00 2001 From: Mitchell Hanberg Date: Mon, 27 Dec 2021 06:10:39 -0600 Subject: [PATCH 2/2] Update Formula/zk.rb Co-authored-by: Sean Molenaar --- Formula/zk.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/zk.rb b/Formula/zk.rb index 0b74424cb445d..4242bab8a642d 100644 --- a/Formula/zk.rb +++ b/Formula/zk.rb @@ -13,7 +13,7 @@ class Zk < Formula uses_from_macos "sqlite" def install - system "go", "build", *std_go_args, "-tags", "fts5,icu", "-ldflags", "-X=main.Version=#{version} -X=main.Build=brew" + system "go", "build", *std_go_args(ldflags: "-X=main.Version=#{version} -X=main.Build=#{tap.user}"), "-tags", "fts5,icu" end test do