forked from toolshed/abra
		
	refactor: put URLs into vars
This commit is contained in:
		| @ -1,6 +1,7 @@ | |||||||
| package cli | package cli | ||||||
|  |  | ||||||
| import ( | import ( | ||||||
|  | 	"fmt" | ||||||
| 	"os/exec" | 	"os/exec" | ||||||
|  |  | ||||||
| 	"coopcloud.tech/abra/cli/internal" | 	"coopcloud.tech/abra/cli/internal" | ||||||
| @ -8,15 +9,19 @@ import ( | |||||||
| 	"github.com/urfave/cli/v2" | 	"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. | // 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{internal.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", fmt.Sprintf("curl -s %s | bash", mainURL)) | ||||||
| 		if internal.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", fmt.Sprintf("curl -s %s | bash -s -- --rc", releaseCandidateURL)) | ||||||
| 		} | 		} | ||||||
| 		logrus.Debugf("attempting to run '%s'", cmd) | 		logrus.Debugf("attempting to run '%s'", cmd) | ||||||
| 		if err := internal.RunCmd(cmd); err != nil { | 		if err := internal.RunCmd(cmd); err != nil { | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user