fix
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
114bdc5ce9
commit
7d80f4d56b
|
@ -287,10 +287,10 @@ var appBackupCommand = cli.Command{
|
||||||
Aliases: []string{"b"},
|
Aliases: []string{"b"},
|
||||||
Usage: "Manage app backups",
|
Usage: "Manage app backups",
|
||||||
ArgsUsage: "<domain>",
|
ArgsUsage: "<domain>",
|
||||||
Subcommands: []cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
appBackupListCommand,
|
&appBackupListCommand,
|
||||||
appBackupSnapshotsCommand,
|
&appBackupSnapshotsCommand,
|
||||||
appBackupDownloadCommand,
|
&appBackupDownloadCommand,
|
||||||
appBackupCreateCommand,
|
&appBackupCreateCommand,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ Example:
|
||||||
internal.ShowSubcommandHelpAndError(c, errors.New("cannot use --local & --user together"))
|
internal.ShowSubcommandHelpAndError(c, errors.New("cannot use --local & --user together"))
|
||||||
}
|
}
|
||||||
|
|
||||||
hasCmdArgs, parsedCmdArgs := parseCmdArgs(c.Args().Slice(), internal.LocalCmd)
|
hasCmdArgs, parsedCmdArgs := parseCmdArgs(c.Args().Slice())
|
||||||
|
|
||||||
abraSh := path.Join(config.RECIPES_DIR, app.Recipe, "abra.sh")
|
abraSh := path.Join(config.RECIPES_DIR, app.Recipe, "abra.sh")
|
||||||
if _, err := os.Stat(abraSh); err != nil {
|
if _, err := os.Stat(abraSh); err != nil {
|
||||||
|
@ -180,23 +180,15 @@ Example:
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseCmdArgs(args []string, isLocal bool) (bool, string) {
|
// Parse the command arguments from the cli args.
|
||||||
var (
|
// Arguments should look like this:
|
||||||
parsedCmdArgs string
|
// DOMAIN COMMAND -- ARGUMENT1 ARGUMENT2 ...
|
||||||
hasCmdArgs bool
|
func parseCmdArgs(args []string) (bool, string) {
|
||||||
)
|
if len(args) < 4 {
|
||||||
|
return false, ""
|
||||||
if isLocal {
|
|
||||||
if len(args) > 3 {
|
|
||||||
return true, fmt.Sprintf("%s ", strings.Join(args[3:], " "))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if len(args) > 3 {
|
|
||||||
return true, fmt.Sprintf("%s ", strings.Join(args[3:], " "))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return hasCmdArgs, parsedCmdArgs
|
return true, fmt.Sprintf("%s ", strings.Join(args[3:], " "))
|
||||||
}
|
}
|
||||||
|
|
||||||
func cmdNameComplete(appName string) {
|
func cmdNameComplete(appName string) {
|
||||||
|
|
|
@ -20,7 +20,7 @@ func TestParseCmdArgs(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
ok, parsed := parseCmdArgs(test.input, false)
|
ok, parsed := parseCmdArgs(test.input)
|
||||||
if ok != test.shouldParse {
|
if ok != test.shouldParse {
|
||||||
t.Fatalf("[%s] should not parse", strings.Join(test.input, " "))
|
t.Fatalf("[%s] should not parse", strings.Join(test.input, " "))
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ var appNewCommand = cli.Command{
|
||||||
ArgsUsage: "[<recipe>] [<version>]",
|
ArgsUsage: "[<recipe>] [<version>]",
|
||||||
BashComplete: func(ctx *cli.Context) {
|
BashComplete: func(ctx *cli.Context) {
|
||||||
args := ctx.Args()
|
args := ctx.Args()
|
||||||
switch len(args) {
|
switch args.Len() {
|
||||||
case 0:
|
case 0:
|
||||||
autocomplete.RecipeNameComplete(ctx)
|
autocomplete.RecipeNameComplete(ctx)
|
||||||
case 1:
|
case 1:
|
||||||
|
|
|
@ -15,7 +15,7 @@ _deploy_app() {
|
||||||
run $ABRA app deploy --no-input "$TEST_APP_DOMAIN"
|
run $ABRA app deploy --no-input "$TEST_APP_DOMAIN"
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
run $ABRA app --server "$TEST_SERVER" --status
|
run $ABRA app ls --server "$TEST_SERVER" --status
|
||||||
assert_success
|
assert_success
|
||||||
assert_output --partial "$TEST_APP_DOMAIN"
|
assert_output --partial "$TEST_APP_DOMAIN"
|
||||||
assert_output --partial 'deployed'
|
assert_output --partial 'deployed'
|
||||||
|
@ -25,7 +25,7 @@ _undeploy_app() {
|
||||||
run $ABRA app undeploy --no-input "$TEST_APP_DOMAIN"
|
run $ABRA app undeploy --no-input "$TEST_APP_DOMAIN"
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
run $ABRA app ls --server "$TEST_SERVER" --status
|
run $ABRA app ls --server "$TEST_SERVER" --status
|
||||||
assert_success
|
assert_success
|
||||||
assert_output --partial "$TEST_APP_DOMAIN"
|
assert_output --partial "$TEST_APP_DOMAIN"
|
||||||
assert_output --partial 'unknown'
|
assert_output --partial 'unknown'
|
||||||
|
|
Loading…
Reference in New Issue