Skip to content

Instantly share code, notes, and snippets.

@doekman
Created January 27, 2020 10:00
Show Gist options
  • Save doekman/6449f5ca2dfdc17b81782ce004eefd68 to your computer and use it in GitHub Desktop.
Save doekman/6449f5ca2dfdc17b81782ce004eefd68 to your computer and use it in GitHub Desktop.
Brew formula for ok-bash for when we are more notable.Create with `brew create --python https://github.com/secretGeek/ok-bash/archive/v0.8.1.tar.gz`
class OkBash < Formula
desc ".ok folder profiles for bash"
homepage "https://github.com/secretGeek/ok-bash"
url "https://github.com/secretGeek/ok-bash/archive/v0.8.1.tar.gz"
sha256 "ec2d65dc617948d071012b7076f47fa0e23e2f47bf3b56ee07a7c5978dd07b50"
bottle :unneeded
def install
(prefix/"etc/profile.d").install "ok.sh"
(prefix/"etc/profile.d").install "ok-show.py"
end
def caveats; <<~EOS
For Bash or Zsh, put something like this in your $HOME/.bashrc or $HOME/.zshrc:
. #{etc}/profile.d/ok.sh
EOS
end
test do
(testpath/".ok").write("echo 1\necho 2\n")
testcmd = "/bin/bash -c '. #{etc}/profile.d/ok.sh; ok -q 2 2>/dev/null'"
assert_match "2", pipe_output(testcmd)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment