Skip to content

Commit b162c54

Browse files
sungwonchodaeho-ro
authored andcommitted
dnote 0.15.2 (new formula)
Simple command line notebook for programmers
1 parent 9f64a6f commit b162c54

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Formula/d/dnote.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
class Dnote < Formula
2+
desc "Simple command-line notebook"
3+
homepage "https://www.getdnote.com"
4+
url "https://github.com/dnote/dnote/archive/refs/tags/cli-v0.15.2.tar.gz"
5+
sha256 "d68fd975a91b1872d15c2bfea12a1b43d8878c9811d1df4876c07f3d10f05e4e"
6+
license "GPL-3.0-only"
7+
head "https://github.com/dnote/dnote.git", branch: "master"
8+
9+
depends_on "go" => :build
10+
11+
def install
12+
ldflags = %W[
13+
-s -w
14+
-X main.versionTag=#{version}
15+
-X main.apiEndpoint=http://localhost:3000/api
16+
]
17+
system "go", "build", *std_go_args(ldflags:), "-tags", "fts5", "./pkg/cli"
18+
end
19+
20+
test do
21+
ENV["XDG_CONFIG_HOME"] = testpath
22+
ENV["XDG_DATA_HOME"] = testpath
23+
ENV["XDG_CACHE_HOME"] = testpath
24+
25+
assert_match version.to_s, shell_output("#{bin}/dnote version")
26+
27+
desc = "Check disk usage with df -h"
28+
system bin/"dnote", "add", "linux", "-c", desc
29+
assert_match desc, shell_output("#{bin}/dnote view linux")
30+
assert_match desc, shell_output("#{bin}/dnote find 'disk usage'")
31+
end
32+
end

0 commit comments

Comments
 (0)