Check if helper command exists before anything else
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Elara 2023-10-10 13:00:31 -07:00
parent 3b382b9747
commit 09ff697b71
1 changed files with 5 additions and 5 deletions

View File

@ -35,6 +35,11 @@ var helperCmd = &cli.Command{
cli.ShowSubcommandHelpAndExit(c, 1)
}
helper, ok := helpers.Helpers[c.Args().First()]
if !ok {
log.Fatal("No such helper command").Str("name", c.Args().First()).Send()
}
wd, err := os.Getwd()
if err != nil {
log.Fatal("Error getting working directory").Err(err).Send()
@ -45,11 +50,6 @@ var helperCmd = &cli.Command{
log.Fatal("Error getting working directory").Err(err).Send()
}
helper, ok := helpers.Helpers[c.Args().First()]
if !ok {
log.Fatal("No such helper command").Str("name", c.Args().First()).Send()
}
hc := interp.HandlerContext{
Env: expand.ListEnviron(
"pkgdir="+c.String("dest-dir"),