Skip to content

Commit

Permalink
Fix macos url in cli
Browse files Browse the repository at this point in the history
  • Loading branch information
zachhuff386 committed Sep 4, 2020
1 parent f128ac8 commit 7491b65
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cli/profile/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func GetAll() (prfls map[string]*Profile, err error) {
return
}

if runtime.GOOS == "linux" {
if runtime.GOOS == "linux" || runtime.GOOS == "darwin" {
req.Host = "unix"
}
req.Header.Set("Auth-Key", authKey)
Expand Down
4 changes: 2 additions & 2 deletions cli/service/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var unixClient = &http.Client{
}

func GetAddress() string {
if runtime.GOOS == "linux" {
if runtime.GOOS == "linux" || runtime.GOOS == "darwin" {
return "http://unix"
} else {
return "http://127.0.0.1:9770"
Expand All @@ -52,7 +52,7 @@ func GetAuthKey() (key string, err error) {
}

func GetClient() *http.Client {
if runtime.GOOS == "linux" {
if runtime.GOOS == "linux" || runtime.GOOS == "darwin" {
return unixClient
} else {
return httpClient
Expand Down
2 changes: 1 addition & 1 deletion cli/sprofile/sprofile.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (s *Sprofile) GetLogs() (data string, err error) {
return
}

if runtime.GOOS == "linux" {
if runtime.GOOS == "linux" || runtime.GOOS == "darwin" {
req.Host = "unix"
}
req.Header.Set("Auth-Key", authKey)
Expand Down
10 changes: 5 additions & 5 deletions cli/sprofile/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func Stop(sprflId string) (err error) {
return
}

if runtime.GOOS == "linux" {
if runtime.GOOS == "linux" || runtime.GOOS == "darwin" {
req.Host = "unix"
}
req.Header.Set("Auth-Key", authKey)
Expand Down Expand Up @@ -185,7 +185,7 @@ func Delete(sprflId string) (err error) {
return
}

if runtime.GOOS == "linux" {
if runtime.GOOS == "linux" || runtime.GOOS == "darwin" {
req.Host = "unix"
}
req.Header.Set("Auth-Key", authKey)
Expand Down Expand Up @@ -227,7 +227,7 @@ func GetAll() (sprfls []*Sprofile, err error) {
return
}

if runtime.GOOS == "linux" {
if runtime.GOOS == "linux" || runtime.GOOS == "darwin" {
req.Host = "unix"
}
req.Header.Set("Auth-Key", authKey)
Expand Down Expand Up @@ -323,7 +323,7 @@ func Start(sprflId, mode, password string) (err error) {
return
}

if runtime.GOOS == "linux" {
if runtime.GOOS == "linux" || runtime.GOOS == "darwin" {
req.Host = "unix"
}
req.Header.Set("Auth-Key", authKey)
Expand Down Expand Up @@ -423,7 +423,7 @@ func Import(data string) (err error) {
return
}

if runtime.GOOS == "linux" {
if runtime.GOOS == "linux" || runtime.GOOS == "darwin" {
req.Host = "unix"
}
req.Header.Set("Auth-Key", authKey)
Expand Down

0 comments on commit 7491b65

Please sign in to comment.