Skip to content

Commit dd16537

Browse files
committed
Clean-up
1 parent 2a3ba0c commit dd16537

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

commands/build.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,17 @@ func (b *buildcmd) build(c *cli.Context) error {
7474
return err
7575
}
7676

77+
buildArgs := c.StringSlice("build-arg")
78+
verbose := c.GlobalBool("verbose")
79+
7780
switch common.GetFuncYamlVersion(ffV) {
7881
case common.LatestYamlVersion:
7982
fpath, ff, err := common.FindAndParseFuncFileV20180708(dir)
8083
if err != nil {
8184
return err
8285
}
8386

84-
buildArgs := c.StringSlice("build-arg")
85-
ff, err = common.BuildFuncV20180708(buildArgs, c.GlobalBool("verbose"), b.noCache, fpath, ff)
87+
ff, err = common.BuildFuncV20180708(buildArgs, verbose, b.noCache, fpath, ff)
8688
if err != nil {
8789
return err
8890
}
@@ -96,10 +98,7 @@ func (b *buildcmd) build(c *cli.Context) error {
9698
return err
9799
}
98100

99-
buildArgs := c.StringSlice("build-arg")
100-
verbpse := c.GlobalBool("verbose")
101-
102-
ff, err = common.BuildFunc(buildArgs, verbpse, b.noCache, fpath, ff)
101+
ff, err = common.BuildFunc(buildArgs, verbose, b.noCache, fpath, ff)
103102
if err != nil {
104103
return err
105104
}

commands/deploy.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,6 @@ func (p *deploycmd) deploy(c *cli.Context) error {
155155
return p.deploySingle(c, deployConfig, appName, appf)
156156
}
157157

158-
type DeployConfig struct {
159-
BuildArgs []string
160-
Verbose bool
161-
NoBump bool
162-
IsLocal bool
163-
NoCache bool
164-
}
165-
166158
// deploySingle deploys a single function, either the current directory or if in the context
167159
// of an app and user provides relative path as the first arg, it will deploy that function.
168160
func (p *deploycmd) deploySingle(c *cli.Context, deployConfig *DeployConfig, appName string, appf *common.AppFile) error {

commands/deploy_api.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ import (
1212
v2Client "github.com/fnproject/fn_go/clientv2"
1313
)
1414

15+
type DeployConfig struct {
16+
BuildArgs []string
17+
Verbose bool
18+
NoBump bool
19+
IsLocal bool
20+
NoCache bool
21+
}
22+
1523
func DeploySingle(clientV1 *fnclient.Fn, clientV2 *v2Client.Fn, deployConfig *DeployConfig, dir, appName string, appf *common.AppFile) error {
1624
wd := common.GetWd()
1725

0 commit comments

Comments
 (0)