File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ class FreshEditor < Formula
2+ desc "Text editor for your terminal: easy, powerful and fast"
3+ homepage "https://sinelaw.github.io/fresh/"
4+ url "https://github.com/sinelaw/fresh/archive/refs/tags/v0.1.18.tar.gz"
5+ sha256 "556a8349a2f3cbd1f6541a98f247ceafe1a1bf7fdb7fc4c0364f1982d99eb20e"
6+ license "GPL-2.0-or-later"
7+
8+ depends_on "rust" => :build
9+
10+ def install
11+ system "cargo" , "install" , *std_cargo_args ( path : "." )
12+ end
13+
14+ test do
15+ # Test script mode: type text, save, and quit
16+ commands = <<~JSON
17+ {"type":"type_text","text":"Hello from Homebrew"}
18+ {"type":"key","code":"s","modifiers":["ctrl"]}
19+ {"type":"quit"}
20+ JSON
21+
22+ pipe_output ( "#{ bin } /fresh --script-mode --no-session test.txt" , commands )
23+ assert_match "Hello from Homebrew" , ( testpath /"test.txt" ) . read
24+ end
25+ end
You can’t perform that action at this time.
0 commit comments