update self [[DDsupport channel

master
codeskyblue 8 years ago
parent cc06b2e1a3
commit e1ed951fd4

@ -7,7 +7,7 @@ triggers:
- '**/*.py'
env:
DEBUG: "1"
cmd: sh ./build.sh
cmd: sh ./run.sh
shell: true
delay: 100ms
signal: TERM

@ -1,3 +1,2 @@
#!/bin/bash -
go build && ./gosuv start-server -f

@ -25,11 +25,12 @@ TxI79zIvne9UT/rDsM0BxSydwtjG00MT
`)
)
func equinoxUpdate() error {
func equinoxUpdate(channel string) error {
var opts equinox.Options
if err := opts.SetPublicKeyPEM(publicKey); err != nil {
return err
}
opts.Channel = channel
// check for the update
resp, err := equinox.Check(appID, opts)
@ -113,7 +114,7 @@ func actionConfigTest(c *cli.Context) error {
}
func actionUpdateSelf(c *cli.Context) error {
return equinoxUpdate()
return equinoxUpdate(c.String("channel"))
}
func main() {
@ -156,8 +157,15 @@ func main() {
Action: actionConfigTest,
},
{
Name: "update-self",
Usage: "Update gosuv itself",
Name: "update-self",
Usage: "Update gosuv itself",
Flags: []cli.Flag{
cli.StringFlag{
Name: "channel, c",
Usage: "update channel name, stable or dev",
Value: "stable",
},
},
Action: actionUpdateSelf,
},
}

Loading…
Cancel
Save