Skip to content

Commit

Permalink
revert: move back to using Downloads folder
Browse files Browse the repository at this point in the history
Turns out I was right the 1st(?) time and you can't overwrite an exe on
windows that's in use like you can on Linux.
  • Loading branch information
lyledouglass committed Jan 1, 2024
1 parent ed8c1e7 commit 0e1d403
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions internal/appUpdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"io"
"net/http"
"os"
"os/user"
"path/filepath"
"regexp"
"strings"
"time"
util "wowtools/pkg/utilities"

"github.com/google/go-github/v56/github"
"github.com/spf13/viper"
)

// Get the latest version of the application from the github api
Expand Down Expand Up @@ -93,13 +93,13 @@ func UpdateApp(appVersion string) {
// can compare the two versions and see if we need to download a new version
if latestVersion > appVersion {
util.Log.Info("New version available, downloading...")
//user, err := user.Current()
user, err := user.Current()
if err != nil {
util.Log.Fatalf("Error getting current user: %s", err)
}
//homeDir := user.HomeDir
downloadApp(client, latestVersion, viper.GetString("retail_dir")+"Wowtools")
util.Log.Info("Upgrade complete")
homeDir := user.HomeDir
downloadApp(client, latestVersion, homeDir+"\\Downloads")
util.Log.Info("New version downloaded to Downloads folder. Please overwrite the existing executable with the new one!")
} else {
util.Log.Info("You are running the latest version")
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func main() {

const version = "5.0.3"
const version = "5.0.4"

var (
logging string
Expand Down

0 comments on commit 0e1d403

Please sign in to comment.