From 991843783dd3cc3cb9751a87efbdd65d95474147 Mon Sep 17 00:00:00 2001 From: Dominik Agres Date: Mon, 23 Mar 2026 19:58:38 +0100 Subject: [PATCH] fix: write commands.json after install --- Formula/cheatsh.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Formula/cheatsh.rb b/Formula/cheatsh.rb index 4d71e54..11dda69 100644 --- a/Formula/cheatsh.rb +++ b/Formula/cheatsh.rb @@ -9,7 +9,20 @@ class Cheatsh < Formula depends_on "go" => :build 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 def caveats