Skip to content

Commit 2334c03

Browse files
Add support for default profile to compile command
1 parent d998d82 commit 2334c03

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

internal/cli/compile/compile.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,15 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
160160
sketchPath := arguments.InitSketchPath(path)
161161
sk := arguments.NewSketch(sketchPath)
162162

163-
inst, profile := instance.CreateAndInitWithProfile(profileArg.Get(), sketchPath)
163+
var inst *rpc.Instance
164+
var profile *rpc.Profile
165+
166+
if profileArg.Get() == "" && fqbnArg.String() == "" {
167+
inst, profile = instance.CreateAndInitWithProfile(sk.Project.DefaultProfile, sketchPath, true)
168+
} else {
169+
inst, profile = instance.CreateAndInitWithProfile(profileArg.Get(), sketchPath, false)
170+
}
171+
164172
if fqbnArg.String() == "" {
165173
fqbnArg.Set(profile.GetFqbn())
166174
}

0 commit comments

Comments
 (0)