diff --git a/.fsw.yml b/.fsw.yml index 1c84aaa..c19f82d 100644 --- a/.fsw.yml +++ b/.fsw.yml @@ -7,7 +7,7 @@ triggers: - '**/*.py' env: DEBUG: "1" - cmd: sh ./build.sh + cmd: sh ./run.sh shell: true delay: 100ms signal: TERM diff --git a/build.sh b/build.sh index c0b690e..59fdb8a 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,2 @@ #!/bin/bash - - go build && ./gosuv start-server -f diff --git a/gosuv.go b/gosuv.go index 34e5b98..35e67b5 100644 --- a/gosuv.go +++ b/gosuv.go @@ -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, }, }