Skip to content

Commit

Permalink
replace equinox with github releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Atrox committed Oct 11, 2017
1 parent 6e99f0b commit a80e207
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 74 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ _testmain.go

# external packages folder
vendor/
cain
cain
dist/
32 changes: 32 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
project_name: cain

release:
github:
owner: atrox
name: cain

builds:
- goos:
- linux
- darwin
- windows
goarch:
- amd64
- 386
- arm
- arm64
binary: cain

archive:
files:
- README.md
- LICENSE
replacements:
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip

checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt'
98 changes: 94 additions & 4 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
name = "github.com/atrox/store"
version = "1.0.1"

[[constraint]]
branch = "master"
name = "github.com/equinox-io/equinox"

[[constraint]]
branch = "v2"
name = "github.com/urfave/cli"

[[constraint]]
name = "github.com/tj/go-update"
version = "1.0.0"
8 changes: 7 additions & 1 deletion commands/update.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package commands

import (
"fmt"

"github.com/atrox/cain/updater"
"github.com/urfave/cli"
)
Expand All @@ -12,9 +14,13 @@ var UpdateCommand = &cli.Command{
}

func updateAction(c *cli.Context) error {
err := updater.ForceRun()
appUpdater := updater.New(true)
updated, err := appUpdater.Run()
if err != nil {
return cli.Exit(err, 1)
}
if !updated {
b.Println("You are on the newest version", "", fmt.Sprintf("Version %s", updater.Version))
}
return nil
}
10 changes: 9 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ var (
appUpdater *updater.Updater
)

func init() {
updater.Version = version
}

func main() {
cmds := []*cli.Command{
commands.SetupCommand,
Expand Down Expand Up @@ -58,7 +62,11 @@ func after(c *cli.Context) error {
return nil
}

return appUpdater.Run()
_, err := appUpdater.Run()
if err != nil {
return cli.Exit(err, 1)
}
return nil
}

var logo = strings.TrimLeft(fmt.Sprintf(`
Expand Down
13 changes: 0 additions & 13 deletions updater/equinox.go

This file was deleted.

Loading

0 comments on commit a80e207

Please sign in to comment.