aboutsummaryrefslogtreecommitdiffstats
path: root/HomebrewFormula/qcd.rb
blob: 7d12dacfbaf8cae0581f378f3904fd6f28a79b07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

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.2.1.tar.gz"
  sha256 "de90ed93ba2d657253df6b8bed46cec2c4c1e796347a39a8449f1059cca33438"

  def install
    prefix.install "qcd"
    bash_completion.install "qcd.bash-completion" => "qcd"
  end

  def caveats
    <<-EOS
      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