Skip to content

Commit

Permalink
feat: cross build setup for main package
Browse files Browse the repository at this point in the history
  • Loading branch information
juev committed Dec 8, 2023
1 parent 6c537f1 commit 1c24883
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
19 changes: 1 addition & 18 deletions cmd/gobrew/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"flag"
"log"
"os"
"runtime"
"strconv"
"strings"

Expand Down Expand Up @@ -167,23 +166,7 @@ Examples:
gobrew use dev-latest # use go version latest avalable, including rc and beta
Installation Path:
`

if runtime.GOOS == "windows" {
msg = msg + `
# Add gobrew to your environment variables
PATH="%USERPROFILE%\.gobrew\current\bin;%USERPROFILE%\.gobrew\bin;%PATH%"
GOROOT="%USERPROFILE%\.gobrew\current\go"
`
} else {
msg = msg + `
# Add gobrew to your ~/.bashrc or ~/.zshrc
export PATH="$HOME/.gobrew/current/bin:$HOME/.gobrew/bin:$PATH"
export GOROOT="$HOME/.gobrew/current/go"
`
}
` + usageMsg

return msg
}
10 changes: 10 additions & 0 deletions cmd/gobrew/main_unix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build unix

package main

const usageMsg = `
# Add gobrew to your ~/.bashrc or ~/.zshrc
export PATH="$HOME/.gobrew/current/bin:$HOME/.gobrew/bin:$PATH"
export GOROOT="$HOME/.gobrew/current/go"
`
8 changes: 8 additions & 0 deletions cmd/gobrew/main_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package main

const usageMsg = `
# Add gobrew to your ~/.bashrc or ~/.zshrc
export PATH="$HOME/.gobrew/current/bin:$HOME/.gobrew/bin:$PATH"
export GOROOT="$HOME/.gobrew/current/go"
`

0 comments on commit 1c24883

Please sign in to comment.