Skip to content

Commit 7289221

Browse files
author
rsora
committed
Add passing of build-path to upload to allow fallback in case of custom build-path
1 parent 0b72f7b commit 7289221

File tree

5 files changed

+123
-103
lines changed

5 files changed

+123
-103
lines changed

cli/compile/compile.go

+1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ func run(cmd *cobra.Command, args []string) {
135135
Verbose: verbose,
136136
Verify: verify,
137137
ImportFile: exportFile,
138+
BuildPath: buildPath,
138139
}, os.Stdout, os.Stderr)
139140

140141
if err != nil {

commands/upload/upload.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,14 @@ func Upload(ctx context.Context, req *rpc.UploadReq, outStream io.Writer, errStr
203203
return nil, fmt.Errorf("cannot open sketch: %s", err)
204204
}
205205
// Built sketch not found in the provided path, let's fallback to the temp compile path
206-
fallbackBuildPath := builder.GenBuildPath(sketchPath)
206+
var fallbackBuildPath *paths.Path
207+
if req.GetBuildPath() != "" {
208+
fallbackBuildPath = paths.New(req.GetBuildPath())
209+
} else {
210+
211+
fallbackBuildPath = builder.GenBuildPath(sketchPath)
212+
}
213+
207214
logrus.Warnf("Built sketch not found in %s, let's fallback to %s", uploadFile, fallbackBuildPath)
208215
uploadProperties.SetPath("build.path", fallbackBuildPath)
209216
// If we search inside the build.path, compile artifact do not have the fqbnSuffix in the filename

rpc/commands/lib.pb.go

+84-81
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)