28 lines
891 B
Ruby
28 lines
891 B
Ruby
class TodoTxt < Formula
|
|
desc "Minimal, todo.txt-focused editor"
|
|
homepage "http://todotxt.com/"
|
|
url "https://github.com/todotxt/todo.txt-cli/releases/download/v2.11.0/todo.txt_cli-2.11.0.tar.gz"
|
|
sha256 "5fe723bea3e3a1e697484cba92b46e90f13150ee1a444c4a9408c2cd28ea5255"
|
|
head "https://github.com/todotxt/todo.txt-cli.git"
|
|
|
|
bottle :unneeded
|
|
|
|
def install
|
|
bin.install "todo.sh"
|
|
prefix.install "todo.cfg" # Default config file
|
|
bash_completion.install "todo_completion"
|
|
end
|
|
|
|
def caveats; <<~EOS
|
|
To configure, copy the default config to your HOME and edit it:
|
|
cp #{prefix}/todo.cfg ~/.todo.cfg
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
cp prefix/"todo.cfg", testpath/".todo.cfg"
|
|
inreplace testpath/".todo.cfg", "export TODO_DIR=$(dirname \"$0\")", "export TODO_DIR=#{testpath}"
|
|
system bin/"todo.sh", "add", "Hello World!"
|
|
system bin/"todo.sh", "list"
|
|
end
|
|
end
|