Skip to content

Commit

Permalink
gws 0.1.8
Browse files Browse the repository at this point in the history
patch the gws script to avoid bug introduced in
0.1.7 (StreakyCobra/gws#17)

the patch updates the 'PATH' with GNU's 'sed' and 'cut'
  • Loading branch information
frodeaa committed Sep 24, 2015
1 parent 596b934 commit 33b0dce
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions Library/Formula/gws.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
class Gws < Formula
homepage "https://streakycobra.github.io/gws/"
desc "Manage workspaces composed of git repositories"
url "https://github.com/StreakyCobra/gws/archive/0.1.7.tar.gz"
sha256 "36c25392f5cb93a39441a1973842249a62b605a2a7e369a040c78450683697d0"
url "https://github.com/StreakyCobra/gws/archive/0.1.8.tar.gz"
sha256 "c240601b0adcc5ae402199217fc0d5fd6775ada69919a860ad3c1c4b16805e63"

depends_on "bash"
depends_on "coreutils" # see bug https://github.com/StreakyCobra/gws/issues/17
depends_on "gnu-sed" # see bug https://github.com/StreakyCobra/gws/issues/17

def install
bin.install "src/gws"

# Add GNU's 'sed' and 'cut' to PATH to fix bug
inreplace "#{bin}/gws" do |s|
s.sub! /VERSION="0.1.8"/, "VERSION=\"0.1.8\"\nexport PATH=#{gws_gnu_path}"
end

bash_completion.install "completions/bash"
zsh_completion.install "completions/zsh"
end

def gws_gnu_path; <<-EOS.undent
"#{Formula["coreutils"].opt_libexec}/gnubin:#{Formula["gnu-sed"].opt_libexec}/gnubin:$PATH"
EOS
end

def caveats; <<-EOS.undent
A bug introduced in 0.1.8 (https://github.com/StreakyCobra/gws/issues/17)
makes gws use some options that are specific to GNU's 'sed' and 'cut',
which are not available to OSX.
gws script has been updated to include GNU's sed and cut in PATH
EOS
end

test do
system "git", "init", "project"
system "#{bin}/gws", "init"
Expand Down

0 comments on commit 33b0dce

Please sign in to comment.