aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2016-07-23 12:34:32 -0400
committerTeddy Wing2016-07-23 12:45:13 -0400
commit3866bef812e5967f1b24c42239cb6436ae773502 (patch)
tree4d5768c3d1a755ade3ee537bb3634c39a30c6ca1
parent3631742cb99b1ea2527de1e2c334e6edb8afc483 (diff)
downloadqcd-3866bef812e5967f1b24c42239cb6436ae773502.tar.bz2
Add Homebrew formula
* Enable installation via Homebrew on OS X. * Update the README to describe how to use Homebrew to install.
-rw-r--r--Homebrew/qcd.rb27
-rw-r--r--README.md6
2 files changed, 32 insertions, 1 deletions
diff --git a/Homebrew/qcd.rb b/Homebrew/qcd.rb
new file mode 100644
index 0000000..00f8067
--- /dev/null
+++ b/Homebrew/qcd.rb
@@ -0,0 +1,27 @@
+class Qcd < Formula
+ desc "Define shortcuts to directories for quick `cd`s"
+ homepage "https://github.com/teddywing/qcd"
+ url "https://github.com/teddywing/qcd/archive/v0.1.0.tar.gz"
+ sha256 "c4bd0541dd1e852a50589012d73eacb86c394d18ccfe876571695bcdba0c82ae"
+
+ def install
+ prefix.install "qcd"
+ bash_completion.install "qcd.bash-completion" => "qcd"
+ end
+
+ def caveats; <<-EOS.undent
+ qcd is a shell function, and must be sourced before it can be used.
+ Add the following command to your bash profile:
+
+ source #{opt_prefix}/qcd
+
+ To enable tab completion, add the following to your bash profile:
+
+ source #{etc}/bash_completion.d/qcd
+ EOS
+ end
+
+ test do
+ shell_output("bash -c 'source #{prefix}/qcd && qcd -h'")
+ end
+end
diff --git a/README.md b/README.md
index 67144a7..27573f8 100644
--- a/README.md
+++ b/README.md
@@ -29,7 +29,11 @@ A Bash utility that enables quick `cd`s using shortcuts.
## Install
-Grab the code and add the following lines to your Bash profile:
+Mac OS X users can install `qcd` with Homebrew:
+
+ $ brew install https://raw.githubusercontent.com/teddywing/qcd/master/Homebrew/qcd.rb
+
+On other platforms, grab the code and add the following lines to your Bash profile:
source ~/path/to/qcd
source ~/path/to/qcd.bash-completion