aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/git-now.rb
blob: 6680e9c9f15761920fa008edaaf3e4f37604895f (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
33
34
35
36
37
require 'formula'

class GitNow < Formula
  homepage 'https://github.com/iwata/git-now'
  url 'https://github.com/iwata/git-now.git', :tag => 'v0.1.0.9'

  head 'https://github.com/iwata/git-now.git', :branch => 'develop'

  depends_on 'gnu-getopt'

  patch :DATA

  def install
    system "make", "prefix=#{libexec}", "install"
    bin.write_exec_script libexec/'bin/git-now'
    zsh_completion.install 'etc/_git-now'
  end
end

# This patch makes sure GNUtools are used on OSX.
# gnu-getopt is keg-only hence the backtick expansion.
# These aliases only exist for the duration of git-now,
# inside the git-now shells. Normal operation of bash is
# unaffected - getopt will still find the version supplied
# by OSX in other shells, for example.
__END__
--- a/git-now
+++ b/git-now
@@ -1,5 +1,7 @@
 #!/bin/sh

+alias getopt='`brew --prefix gnu-getopt`/bin/getopt'
+
 # enable debug mode
 if [ "$DEBUG" = "yes" ]; then
   set -x