fix: write commands.json after install

This commit is contained in:
2026-03-23 19:58:38 +01:00
parent feff09c782
commit 991843783d
+14 -1
View File
@@ -9,7 +9,20 @@ class Cheatsh < Formula
depends_on "go" => :build depends_on "go" => :build
def install def install
system "make", "install", "PREFIX=#{prefix}" system "make", "install",
"PREFIX=#{prefix}",
"SYSCONFDIR=#{etc}/cheatsh"
end
def post_install
config_dir = "#{Dir.home}/.config/cheatsh"
FileUtils.mkdir_p config_dir
["commands.json", "commands_template.json"].each do |f|
src = "#{etc}/cheatsh/#{f}"
dest = "#{config_dir}/#{f}"
FileUtils.cp(src, dest)
end
end end
def caveats def caveats