-
-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add self-upgrade feature #38
Conversation
I have made the changes as mentioned by you. Pls review it. Thanks |
return cli.Exit("Failed to extract file: "+err.Error(), 1) | ||
} | ||
newExePath := filepath.Join(tempDir, "vfox") | ||
if err := os.Rename(newExePath, exePath); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you directly replace it, it should be possible under unix-like
system, but is it also possible under windows
? Will it not prompt that the current file(exePath
) is occupied? The current process has not ended yet.
osType := strings.ToLower(runtime.GOOS) | ||
if osType == "darwin" { | ||
osType = "macos" | ||
} | ||
|
||
archType := runtime.GOARCH | ||
if archType == "arm64" { | ||
archType = "aarch64" | ||
} | ||
|
||
fileName := fmt.Sprintf("vfox_%s_%s_%s.tar.gz", tagName[1:], osType, archType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean that Windows system self-update is not supported?
How is it going? May I help? |
Close in favor of #239 |
Feature is added as described in issue #31 .