Skip to content

Commit

Permalink
fix Mac and Windows issue on survey
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpalide committed Jul 13, 2024
1 parent 8229606 commit 556a5a3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
14 changes: 12 additions & 2 deletions pkg/visor/visorconfig/values_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,23 @@ type Survey struct {
}

// SystemSurvey returns system survey
func SystemSurvey() (Survey, error) {
func SystemSurvey(dmsgDisc string) (Survey, error) {
disks, err := ghw.Block(ghw.WithDisableWarnings())
if err != nil {
return Survey{}, err
}
var ipInfo IPSkycoin
fetchedIPInfo, err := IPSkycoinFetch()
if err != nil {
ipValue, err := IPSkycoinFetchDmsg(dmsgDisc)
if err == nil {
ipInfo.IPAddress = ipValue
}
} else {
ipInfo = *fetchedIPInfo
}
s := Survey{
IPInfo: IPSkycoinFetch(),
IPInfo: &ipInfo,
IPAddr: IPA(),
GOOS: runtime.GOOS,
GOARCH: runtime.GOARCH,
Expand Down
14 changes: 12 additions & 2 deletions pkg/visor/visorconfig/values_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type Survey struct {
}

// SystemSurvey returns system survey
func SystemSurvey() (Survey, error) {
func SystemSurvey(dmsgDisc string) (Survey, error) {
disks, err := ghw.Block(ghw.WithDisableWarnings())
if err != nil {
return Survey{}, err
Expand All @@ -57,8 +57,18 @@ func SystemSurvey() (Survey, error) {
if err != nil {
return Survey{}, err
}
var ipInfo IPSkycoin
fetchedIPInfo, err := IPSkycoinFetch()
if err != nil {
ipValue, err := IPSkycoinFetchDmsg(dmsgDisc)
if err == nil {
ipInfo.IPAddress = ipValue
}
} else {
ipInfo = *fetchedIPInfo
}
s := Survey{
IPInfo: IPSkycoinFetch(),
IPInfo: &ipInfo,
GOOS: runtime.GOOS,
GOARCH: runtime.GOARCH,
UUID: uuid.New(),
Expand Down

0 comments on commit 556a5a3

Please sign in to comment.