forked from toolshed/abra
refactor: less quotes
This commit is contained in:
@ -41,7 +41,7 @@ var appBackupCommand = &cli.Command{
|
||||
abraSh := path.Join(config.ABRA_DIR, "apps", app.Type, "abra.sh")
|
||||
if _, err := os.Stat(abraSh); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
logrus.Fatalf("'%s' does not exist?", abraSh)
|
||||
logrus.Fatalf("%s does not exist?", abraSh)
|
||||
}
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
@ -62,7 +62,7 @@ var appBackupCommand = &cli.Command{
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
if !strings.Contains(string(bytes), execCmd) {
|
||||
logrus.Fatalf("%s doesn't have a '%s' function", app.Type, execCmd)
|
||||
logrus.Fatalf("%s doesn't have a %s function", app.Type, execCmd)
|
||||
}
|
||||
|
||||
sourceAndExec := fmt.Sprintf("%s; %s", sourceCmd, execCmd)
|
||||
|
@ -23,7 +23,7 @@ var appCheckCommand = &cli.Command{
|
||||
envSamplePath := path.Join(config.ABRA_DIR, "apps", app.Type, ".env.sample")
|
||||
if _, err := os.Stat(envSamplePath); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
logrus.Fatalf("'%s' does not exist?", envSamplePath)
|
||||
logrus.Fatalf("%s does not exist?", envSamplePath)
|
||||
}
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
@ -45,7 +45,7 @@ var appCheckCommand = &cli.Command{
|
||||
logrus.Fatalf("%s is missing %s", app.Path, missingEnvVars)
|
||||
}
|
||||
|
||||
logrus.Infof("all necessary environment variables defined for '%s'", app.Name)
|
||||
logrus.Infof("all necessary environment variables defined for %s", app.Name)
|
||||
|
||||
return nil
|
||||
},
|
||||
|
@ -31,7 +31,7 @@ var appConfigCommand = &cli.Command{
|
||||
|
||||
appFile, exists := files[appName]
|
||||
if !exists {
|
||||
logrus.Fatalf("cannot find app with name '%s'", appName)
|
||||
logrus.Fatalf("cannot find app with name %s", appName)
|
||||
}
|
||||
|
||||
ed, ok := os.LookupEnv("EDITOR")
|
||||
|
@ -60,7 +60,7 @@ var appRemoveCommand = &cli.Command{
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
if isDeployed {
|
||||
logrus.Fatalf("'%s' is still deployed. Run \"abra app undeploy %s \" or pass --force", app.Name, app.Name)
|
||||
logrus.Fatalf("%s is still deployed. Run \"abra app undeploy %s \" or pass --force", app.Name, app.Name)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ var appRestoreCommand = &cli.Command{
|
||||
abraSh := path.Join(config.ABRA_DIR, "apps", app.Type, "abra.sh")
|
||||
if _, err := os.Stat(abraSh); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
logrus.Fatalf("'%s' does not exist?", abraSh)
|
||||
logrus.Fatalf("%s does not exist?", abraSh)
|
||||
}
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
@ -60,7 +60,7 @@ var appRestoreCommand = &cli.Command{
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
if !strings.Contains(string(bytes), execCmd) {
|
||||
logrus.Fatalf("%s doesn't have a '%s' function", app.Type, execCmd)
|
||||
logrus.Fatalf("%s doesn't have a %s function", app.Type, execCmd)
|
||||
}
|
||||
|
||||
backupFile := c.Args().Get(2)
|
||||
|
@ -50,7 +50,7 @@ recipes.
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
logrus.Debugf("checking whether '%s' is already deployed", stackName)
|
||||
logrus.Debugf("checking whether %s is already deployed", stackName)
|
||||
|
||||
isDeployed, deployedVersion, err := stack.IsDeployed(c.Context, cl, stackName)
|
||||
if err != nil {
|
||||
@ -58,7 +58,7 @@ recipes.
|
||||
}
|
||||
|
||||
if !isDeployed {
|
||||
logrus.Fatalf("'%s' is not deployed?", app.Name)
|
||||
logrus.Fatalf("%s is not deployed?", app.Name)
|
||||
}
|
||||
|
||||
catl, err := catalogue.ReadRecipeCatalogue()
|
||||
@ -75,7 +75,7 @@ recipes.
|
||||
if deployedVersion == "" {
|
||||
deployedVersion = "unknown"
|
||||
availableDowngrades = versions
|
||||
logrus.Warnf("failed to determine version of deployed '%s'", app.Name)
|
||||
logrus.Warnf("failed to determine version of deployed %s", app.Name)
|
||||
}
|
||||
|
||||
if deployedVersion != "unknown" && !internal.Chaos {
|
||||
@ -108,10 +108,10 @@ recipes.
|
||||
if !internal.Chaos {
|
||||
if internal.Force {
|
||||
chosenDowngrade = availableDowngrades[0]
|
||||
logrus.Debugf("choosing '%s' as version to downgrade to (--force)", chosenDowngrade)
|
||||
logrus.Debugf("choosing %s as version to downgrade to (--force)", chosenDowngrade)
|
||||
} else {
|
||||
prompt := &survey.Select{
|
||||
Message: fmt.Sprintf("Please select a downgrade (current version: '%s'):", deployedVersion),
|
||||
Message: fmt.Sprintf("Please select a downgrade (current version: %s):", deployedVersion),
|
||||
Options: availableDowngrades,
|
||||
}
|
||||
if err := survey.AskOne(prompt, &chosenDowngrade); err != nil {
|
||||
|
@ -60,7 +60,7 @@ var appSecretGenerateCommand = &cli.Command{
|
||||
}
|
||||
}
|
||||
if !matches {
|
||||
logrus.Fatalf("'%s' doesn't exist in the env config?", secretName)
|
||||
logrus.Fatalf("%s doesn't exist in the env config?", secretName)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ volumes as eligiblef or pruning once undeployed.
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
logrus.Debugf("checking whether '%s' is already deployed", stackName)
|
||||
logrus.Debugf("checking whether %s is already deployed", stackName)
|
||||
|
||||
isDeployed, deployedVersion, err := stack.IsDeployed(c.Context, cl, stackName)
|
||||
if err != nil {
|
||||
@ -35,7 +35,7 @@ volumes as eligiblef or pruning once undeployed.
|
||||
}
|
||||
|
||||
if !isDeployed {
|
||||
logrus.Fatalf("'%s' is not deployed?", stackName)
|
||||
logrus.Fatalf("%s is not deployed?", stackName)
|
||||
}
|
||||
|
||||
if err := internal.DeployOverview(app, deployedVersion, "continue with undeploy?"); err != nil {
|
||||
|
Reference in New Issue
Block a user