refactor: move flag to internal/common
This commit is contained in:
parent
a925da8dee
commit
9ddf69b988
|
@ -284,6 +284,17 @@ var VerboseFlag = &cli.BoolFlag{
|
||||||
Usage: "Show INFO messages",
|
Usage: "Show INFO messages",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RC signifies the latest release candidate
|
||||||
|
var RC bool
|
||||||
|
|
||||||
|
// RCFlag chooses the latest release candidate for install
|
||||||
|
var RCFlag = &cli.BoolFlag{
|
||||||
|
Name: "rc",
|
||||||
|
Value: false,
|
||||||
|
Destination: &RC,
|
||||||
|
Usage: "Insatll the latest release candidate",
|
||||||
|
}
|
||||||
|
|
||||||
// SSHFailMsg is a hopefully helpful SSH failure message
|
// SSHFailMsg is a hopefully helpful SSH failure message
|
||||||
var SSHFailMsg = `
|
var SSHFailMsg = `
|
||||||
Woops, Abra is unable to connect to connect to %s.
|
Woops, Abra is unable to connect to connect to %s.
|
||||||
|
|
|
@ -8,22 +8,14 @@ import (
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var RC bool
|
|
||||||
var RCFlag = &cli.BoolFlag{
|
|
||||||
Name: "rc",
|
|
||||||
Value: false,
|
|
||||||
Destination: &RC,
|
|
||||||
Usage: "Insatll the latest Release Candidate",
|
|
||||||
}
|
|
||||||
|
|
||||||
// UpgradeCommand upgrades abra in-place.
|
// UpgradeCommand upgrades abra in-place.
|
||||||
var UpgradeCommand = &cli.Command{
|
var UpgradeCommand = &cli.Command{
|
||||||
Name: "upgrade",
|
Name: "upgrade",
|
||||||
Usage: "Upgrade abra",
|
Usage: "Upgrade abra",
|
||||||
Flags: []cli.Flag{RCFlag},
|
Flags: []cli.Flag{internal.RCFlag},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
cmd := exec.Command("bash", "-c", "curl -s https://install.abra.coopcloud.tech | bash")
|
cmd := exec.Command("bash", "-c", "curl -s https://install.abra.coopcloud.tech | bash")
|
||||||
if RC {
|
if internal.RC {
|
||||||
cmd = exec.Command("bash", "-c", "curl -s https://git.coopcloud.tech/coop-cloud/abra/raw/branch/main/scripts/installer/installer | bash -s -- --rc")
|
cmd = exec.Command("bash", "-c", "curl -s https://git.coopcloud.tech/coop-cloud/abra/raw/branch/main/scripts/installer/installer | bash -s -- --rc")
|
||||||
}
|
}
|
||||||
logrus.Debugf("attempting to run '%s'", cmd)
|
logrus.Debugf("attempting to run '%s'", cmd)
|
||||||
|
|
Loading…
Reference in New Issue