Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Conversation

ankit-pn
Copy link
Contributor

Feature is added as described in issue #31 .

cmd/commands/upgrade.go Outdated Show resolved Hide resolved
cmd/commands/upgrade.go Show resolved Hide resolved
cmd/commands/upgrade.go Outdated Show resolved Hide resolved
cmd/commands/upgrade.go Show resolved Hide resolved
@ankit-pn
Copy link
Contributor Author

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 {
Copy link
Member

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.

Comment on lines +61 to +71
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)
Copy link

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?

@yanecc
Copy link
Contributor

yanecc commented Apr 23, 2024

How is it going? May I help?

@aooohan
Copy link
Member

aooohan commented Apr 26, 2024

Close in favor of #239

@aooohan aooohan closed this Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants