forked from toolshed/abra
refactor: merge top-level into one file
This commit is contained in:
@ -1,45 +0,0 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
|
||||
"coopcloud.tech/abra/cli/internal"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var mainURL = "https://install.abra.coopcloud.tech"
|
||||
|
||||
var releaseCandidateURL = "https://git.coopcloud.tech/coop-cloud/abra/raw/branch/main/scripts/installer/installer"
|
||||
|
||||
// UpgradeCommand upgrades abra in-place.
|
||||
var UpgradeCommand = &cli.Command{
|
||||
Name: "upgrade",
|
||||
Usage: "Upgrade Abra itself",
|
||||
Aliases: []string{"u"},
|
||||
Description: `
|
||||
This command allows you to upgrade Abra in-place with the latest stable or
|
||||
release candidate.
|
||||
|
||||
If you would like to install the latest release candidate, please pass the
|
||||
"--rc" option. Please bear in mind that the latest release candidate may have
|
||||
some catastrophic bugs contained in it. In any case, thank you very much for
|
||||
testing efforts!
|
||||
`,
|
||||
Flags: []cli.Flag{internal.RCFlag},
|
||||
Action: func(c *cli.Context) error {
|
||||
cmd := exec.Command("bash", "-c", fmt.Sprintf("curl -s %s | bash", mainURL))
|
||||
if internal.RC {
|
||||
cmd = exec.Command("bash", "-c", fmt.Sprintf("curl -s %s | bash -s -- --rc", releaseCandidateURL))
|
||||
}
|
||||
|
||||
logrus.Debugf("attempting to run %s", cmd)
|
||||
|
||||
if err := internal.RunCmd(cmd); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user