diff --git a/cli/app.go b/cli/app.go index fd50b9c566d..b702d2dc978 100644 --- a/cli/app.go +++ b/cli/app.go @@ -61,6 +61,7 @@ const ( moduleBuildFlagPlatform = "platform" moduleBuildFlagWait = "wait" moduleBuildFlagToken = "token" + moduleBuildFlagWorkdir = "workdir" moduleBuildFlagGroupLogs = "group-logs" moduleBuildRestartOnly = "restart-only" moduleBuildFlagNoBuild = "no-build" @@ -1629,6 +1630,11 @@ Example: Name: moduleBuildFlagToken, Usage: "checkout token for private repos, not necessary for public repos", }, + &cli.StringFlag{ + Name: moduleBuildFlagWorkdir, + Usage: "use this to indicate that your meta.json is in a subdirectory of your repo." + " --module flag should be relative to this", + Value: ".", + }, }, Action: ModuleBuildStartAction, }, diff --git a/cli/module_build.go b/cli/module_build.go index 70362f7a079..a48c64adeb2 100644 --- a/cli/module_build.go +++ b/cli/module_build.go @@ -78,6 +78,7 @@ func (c *viamClient) moduleBuildStartAction(cCtx *cli.Context) error { gitRef := cCtx.String(moduleBuildFlagRef) token := cCtx.String(moduleBuildFlagToken) + workdir := cCtx.String(moduleBuildFlagWorkdir) req := buildpb.StartBuildRequest{ Repo: manifest.URL, Ref: &gitRef, @@ -85,6 +86,7 @@ func (c *viamClient) moduleBuildStartAction(cCtx *cli.Context) error { ModuleId: manifest.ModuleID, ModuleVersion: version, Token: &token, + Workdir: &workdir, } if err := c.ensureLoggedIn(); err != nil { return err diff --git a/go.mod b/go.mod index 303eb9a961b..f07cf0b0f0d 100644 --- a/go.mod +++ b/go.mod @@ -83,7 +83,7 @@ require ( go.uber.org/atomic v1.11.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.24.0 - go.viam.com/api v0.1.345 + go.viam.com/api v0.1.347 go.viam.com/test v1.1.1-0.20220913152726-5da9916c08a2 go.viam.com/utils v0.1.104 goji.io v2.0.2+incompatible diff --git a/go.sum b/go.sum index c9de958d8f9..6ff22ce2a0e 100644 --- a/go.sum +++ b/go.sum @@ -1607,8 +1607,8 @@ go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -go.viam.com/api v0.1.345 h1:QE7KWhkgIpclAG/aJSI3kIi6Mu5bLhutgrTLCy+QzfI= -go.viam.com/api v0.1.345/go.mod h1:5lpVRxMsKFCaahqsnJfPGwJ9baoQ6PIKQu3lxvy6Wtw= +go.viam.com/api v0.1.347 h1:A1kDle9+Im0OKnFmqmJXha+RMzzH2oBjykUQ8TuKvF0= +go.viam.com/api v0.1.347/go.mod h1:5lpVRxMsKFCaahqsnJfPGwJ9baoQ6PIKQu3lxvy6Wtw= go.viam.com/test v1.1.1-0.20220913152726-5da9916c08a2 h1:oBiK580EnEIzgFLU4lHOXmGAE3MxnVbeR7s1wp/F3Ps= go.viam.com/test v1.1.1-0.20220913152726-5da9916c08a2/go.mod h1:XM0tej6riszsiNLT16uoyq1YjuYPWlRBweTPRDanIts= go.viam.com/utils v0.1.104 h1:UrO870aDYf48iw81Gts/r/9OaqNEpTKYF5tzQ2im5tw=