Skip to content

Commit

Permalink
add isUnderAppData function for windows script installer in checker
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed Jan 3, 2022
1 parent 29e95d9 commit e6acc1f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/checker/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func Check(buildVersion string, isCmd bool) {
isFromGo := isUnderGo()
isFromUsrBinDir := isUnderUsr()
isFromGHCLI := isUnderGHCLI()
isFromAppData := isUnderAppData()

var command = func() string {
if isFromHomebrewTap {
Expand All @@ -30,6 +31,8 @@ func Check(buildVersion string, isCmd bool) {
return "curl -fsSL https://git.io/resto | bash"
} else if isFromGHCLI {
return "gh extention upgrade resto"
} else if isFromAppData {
return "iwr -useb https://git.io/resto-win | iex"
}

return ""
Expand Down Expand Up @@ -63,6 +66,10 @@ func isUnderUsr() bool {
return strings.Contains(restoExe, "usr")
}

func isUnderAppData() bool {
return strings.Contains(restoExe, "AppData")
}

func isUnderGHCLI() bool {
return strings.Contains(restoExe, "gh")
}

0 comments on commit e6acc1f

Please sign in to comment.