Skip to content

Commit

Permalink
Implement self-update for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevsaddam committed Nov 3, 2021
1 parent 77e4a19 commit 2033db6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,15 @@ func SelfUpdate(ctx context.Context, buildDate, version string) error {

switch os {
case "windows":
return fmt.Errorf("update: not implemented for %s", os)
if arch == "amd64" || arch == "x86_64" {
err = updateBinary(ctx, releaseInfo.getDownloadURL("windows_amd64.exe"))
} else {
err = updateBinary(ctx, releaseInfo.getDownloadURL("windows_386.exe"))
}

case "darwin":
err = updateBinary(ctx, releaseInfo.getDownloadURL("mac_amd64"))

case "linux":
if arch == "amd64" || arch == "x86_64" {
err = updateBinary(ctx, releaseInfo.getDownloadURL("linux_amd64"))
Expand Down

0 comments on commit 2033db6

Please sign in to comment.