Created
January 14, 2014 20:03
-
-
Save adnissen/8424683 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this code doesn't work: | |
def install | |
# override any environmental vars, set our gopath to one we know will work | |
build_directory = buildpath/"build" | |
build_directory.mkpath | |
ENV["GOPATH"] = build_directory | |
system "echo", ENV["GOPATH"] | |
system "cd " + build_directory | |
system "go", "build", "-o", "hugo", "main.go" | |
bin.install 'hugo' | |
end | |
#error | |
main.go:17:2: cannot find package "github.com/spf13/hugo/commands" in any of: | |
/usr/local/Cellar/go/1.2/libexec/src/pkg/github.com/spf13/hugo/commands (from $GOROOT) | |
/private/tmp/hugo-mW6N/hugo-0.9/build/src/github.com/spf13/hugo/commands (from $GOPATH) | |
#ok, so I would assume it's just downloading to the wrong directory or something | |
#but this code works: | |
# override any environmental vars, set our gopath to one we know will work | |
+ ENV["GOPATH"] = "#{HOMEBREW_PREFIX}/var/go/gopath" | |
+ | |
+ system "go get github.com/spf13/hugo" | |
+ system "cd #{HOMEBREW_PREFIX}/var/go/gopath" | |
+ system "go build -o hugo main.go" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment