From 608629c7ef2e5d61f102d0a458aac0a1fb26e997 Mon Sep 17 00:00:00 2001 From: Denis Makogon Date: Tue, 25 Jul 2017 23:31:38 +0300 Subject: [PATCH] Add --ignore-fn-file while attempting to update route Implements: #132 --- cli/routes.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cli/routes.go b/cli/routes.go index d7c82c2fc..8e1deb64c 100644 --- a/cli/routes.go +++ b/cli/routes.go @@ -54,6 +54,12 @@ var routeFlags = []cli.Flag{ }, } +var updateRouteFlags = append(routeFlags, + cli.BoolFlag{ + Name: "ignore-fn-file", + Usage: "defines whether skip func file or not", + }) + func routes() cli.Command { r := routesCmd{client: client.APIClient()} @@ -90,7 +96,7 @@ func routes() cli.Command { Usage: "update a route in an `app`", ArgsUsage: " ", Action: r.update, - Flags: routeFlags, + Flags: updateRouteFlags, }, { Name: "config", @@ -361,8 +367,10 @@ func (a *routesCmd) update(c *cli.Context) error { rt := &fnmodels.Route{} - if err := routeWithFuncFile(c, nil, rt); err != nil { - return fmt.Errorf("error updating route: %s", err) + if !c.Bool("ignore-fn-file") { + if err := routeWithFuncFile(c, nil, rt); err != nil { + return fmt.Errorf("error updating route: %s", err) + } } routeWithFlags(c, rt)