mirror of
https://github.com/agresdominik/repo.git
synced 2026-07-21 15:40:55 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| affcf9bfdd | |||
| 2d78239127 | |||
| 1be662a23d | |||
| a5c66a6afd |
+16
-24
@@ -1,41 +1,33 @@
|
|||||||
class Cheatsh < Formula
|
class Cheatsh < Formula
|
||||||
desc "a terminal cheat sheet for linux"
|
desc "Terminal cheat sheet TUI for commands you keep forgetting"
|
||||||
homepage "https://github.com/agresdominik/cheat_sheet"
|
homepage "https://github.com/agresdominik/cheat_sheet"
|
||||||
version "0.1.2"
|
version "0.1.2"
|
||||||
url "https://github.com/agresdominik/cheat_sheet/archive/refs/tags/v0.1.2.tar.gz"
|
url "https://github.com/agresdominik/cheat_sheet/archive/refs/tags/v0.1.3.tar.gz"
|
||||||
sha256 "b6df830340da71fbe85d972c82432479f8c4d45f821cad489c6ef2e719d88152"
|
sha256 "1d5a26d290fe40518abc65698bd7dee028d80339680eb8249e8e632b740991e4"
|
||||||
license "GPL-3.0"
|
license "GPL-3.0-only"
|
||||||
|
|
||||||
depends_on "go" => :build
|
depends_on "go" => :build
|
||||||
|
|
||||||
def install
|
def install
|
||||||
system "make", "install",
|
system "go", "build", *std_go_args(output: bin/"cheatsh"), "./src"
|
||||||
"PREFIX=#{prefix}",
|
pkgshare.install "data/commands.json", "data/commands_template.json"
|
||||||
"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
|
||||||
<<~EOS
|
<<~EOS
|
||||||
Default config files are stored in:
|
cheatsh uses the bundled command list by default (updated on `brew upgrade`):
|
||||||
#{etc}/cheatsh/
|
#{opt_pkgshare}/commands.json
|
||||||
|
|
||||||
To set up your config on first run:
|
To use your own list, copy the template and pass it explicitly:
|
||||||
cp #{etc}/cheatsh/commands_template.json ~/.config/cheatsh/
|
cp #{opt_pkgshare}/commands_template.json ~/my-commands.json
|
||||||
|
cheatsh --config ~/my-commands.json
|
||||||
|
|
||||||
|
Copying to the clipboard needs a backend on Linux:
|
||||||
|
wl-clipboard (Wayland) or xsel / xclip (X11). macOS works out of the box.
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
test do
|
test do
|
||||||
system "#{bin}/myapp", "--help"
|
assert_match "Usage", shell_output("#{bin}/cheatsh --help")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ brew tap agresdominik/repo https://github.com/agresdominik/repo
|
|||||||
|
|
||||||
### cheatsh
|
### cheatsh
|
||||||
|
|
||||||
```brew
|
```bash
|
||||||
brew install cheatsh
|
brew install agresdominik/repo/cheatsh
|
||||||
```
|
```
|
||||||
|
|
||||||
Visit [cheat_sheet](https://github.com/agresdominik/cheat_sheet) to see more info
|
Visit [cheat_sheet](https://github.com/agresdominik/cheat_sheet) to see more info
|
||||||
|
|||||||
Reference in New Issue
Block a user