Skip to content

Commit

Permalink
cmd/vinegar: remove old prefix always
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Feb 2, 2024
1 parent b00420e commit ff1029d
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions cmd/vinegar/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ func main() {
case "delete", "edit", "version":
switch cmd {
case "delete":
Delete()
log.Println("Deleting Wineprefixes and Roblox Binary deployments!")

if err := os.RemoveAll(dirs.Prefixes); err != nil {
log.Fatal(err)
}
case "edit":
if err := editor.Edit(*configPath); err != nil {
log.Fatal(err)
Expand All @@ -49,6 +53,8 @@ func main() {
fmt.Println("Vinegar", Version)
}
case "player", "studio", "sysinfo":
DeleteOldPrefix() // Remove after a few releases

cfg, err := config.Load(*configPath)
if err != nil {
log.Fatal(err)
Expand Down Expand Up @@ -110,8 +116,14 @@ func main() {
}
}

func Delete() {
log.Println("Deleting Wineprefix")
func DeleteOldPrefix() {
// The old prefix does not exist or has issues, return.
_, err := os.Stat(dirs.Prefix)
if err != nil {
return
}

log.Println("Deleting deprecated old Wineprefix!")
if err := os.RemoveAll(dirs.Prefix); err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit ff1029d

Please sign in to comment.