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

Avoid git console windows #44

Merged
merged 2 commits into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,24 @@
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": []
"configurations": [
{
// dlv debug --headless --listen localhost:2345 --api-version 2 --build-flags "-ldflags='-H windowsgui'"
"name": "Connect to server",
"type": "go",
"request": "attach",
"mode": "remote",
"remotePath": "${workspaceFolder}",
"port": 2345,
"host": "127.0.0.1"
},
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"buildFlags": "-ldflags='-H windowsgui'",
"mode": "auto",
"program": "${workspaceFolder}"
}
]
}
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/google/uuid v1.3.0
github.com/lxn/walk v0.0.0-20210112085537-c389da54e794
github.com/rhysd/go-github-selfupdate v1.2.3
github.com/sirupsen/logrus v1.8.1
github.com/tidwall/jsonc v0.3.2
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9
gotest.tools v2.2.0+incompatible
Expand All @@ -20,7 +21,6 @@ require (
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf // indirect
github.com/lxn/win v0.0.0-20210218163916-a377121e959e // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/tcnksm/go-gitconfig v0.1.2 // indirect
github.com/ulikunitz/xz v0.5.9 // indirect
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect
Expand All @@ -30,3 +30,5 @@ require (
gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)

replace github.com/rhysd/go-github-selfupdate v1.2.3 => github.com/stuartleeks/go-github-selfupdate v1.2.4
7 changes: 5 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand Down Expand Up @@ -28,12 +29,14 @@ github.com/onsi/gomega v1.4.2 h1:3mYCb7aPxS/RU7TI1y4rkEn1oKmPRjNJLNEXgw7MH2I=
github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rhysd/go-github-selfupdate v1.2.3 h1:iaa+J202f+Nc+A8zi75uccC8Wg3omaM7HDeimXA22Ag=
github.com/rhysd/go-github-selfupdate v1.2.3/go.mod h1:mp/N8zj6jFfBQy/XMYoWsmfzxazpPAODuqarmPDe2Rg=
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stuartleeks/go-github-selfupdate v1.2.4 h1:NouxmmBBSSZNK7SG+16YGqqYMYGADJxCVzk6BwuS/l0=
github.com/stuartleeks/go-github-selfupdate v1.2.4/go.mod h1:mp/N8zj6jFfBQy/XMYoWsmfzxazpPAODuqarmPDe2Rg=
github.com/tcnksm/go-gitconfig v0.1.2 h1:iiDhRitByXAEyjgBqsKi9QU4o2TNtv9kPP3RgPgXBPw=
github.com/tcnksm/go-gitconfig v0.1.2/go.mod h1:/8EhP4H7oJZdIPyT+/UIsG87kTzrzM4UsLGSItWYCpE=
github.com/tidwall/jsonc v0.3.2 h1:ZTKrmejRlAJYdn0kcaFqRAKlxxFIC21pYq8vLa4p2Wc=
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func PerformUpdateCheck(settings *config.Settings) error {
if err != nil {
return fmt.Errorf("failed to locate executable:\n%s", err)
}
if err := selfupdate.UpdateTo(latest.AssetURL, exe); err != nil {
if err := selfupdate.NoGitUpdater().UpdateTo(latest, exe); err != nil {
return fmt.Errorf("failed to perform update:\n%s", err)
}

Expand Down
4 changes: 2 additions & 2 deletions update.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func HandleUpdate() error {
if err != nil {
return fmt.Errorf("could not locate executable path: %v", err)
}
if err := selfupdate.UpdateTo(latest.AssetURL, exe); err != nil {
if err := selfupdate.NoGitUpdater().UpdateTo(latest, exe); err != nil {
return fmt.Errorf("error occurred while updating binary: %v", err)
}
fmt.Printf("Successfully updated to version %s\n", latest.Version)
Expand All @@ -53,7 +53,7 @@ func HandleUpdate() error {

func CheckForUpdate(currentVersion string) (*selfupdate.Release, error) {

latest, found, err := selfupdate.DetectLatest("stuartleeks/pick-a-browser")
latest, found, err := selfupdate.NoGitUpdater().DetectLatest("stuartleeks/pick-a-browser")
if err != nil {
return nil, fmt.Errorf("error occurred while detecting version: %v", err)
}
Expand Down