Fixes async payload passing for #68.

This commit is contained in:
Travis Reeder
2017-06-20 11:32:51 -07:00
parent c94dab3d45
commit 8c96d3ba2f
23 changed files with 276 additions and 225 deletions

View File

@@ -50,6 +50,7 @@ type initFnCmd struct {
entrypoint string
cmd string
format string
typeS string
}
func initFn() cli.Command {
@@ -83,6 +84,12 @@ func initFn() cli.Command {
Destination: &a.format,
Value: "",
},
cli.StringFlag{
Name: "type",
Usage: "sync or async",
Destination: &a.typeS,
Value: "",
},
},
}
}
@@ -124,10 +131,14 @@ func (a *initFnCmd) init(c *cli.Context) error {
Entrypoint: a.entrypoint,
Cmd: a.cmd,
Format: ffmt,
Type: &a.typeS,
}
if ff.Type != nil && *ff.Type == "" {
ff.Type = nil
}
_, path := appNamePath(ff.FullName())
ff.Path = &path
ff.Path = path
if err := encodeFuncfileYAML("func.yaml", ff); err != nil {
return err