@@ -23,7 +23,6 @@ import (
23
23
"strings"
24
24
25
25
"github.com/arduino/arduino-cli/arduino"
26
- "github.com/arduino/arduino-cli/arduino/sketch"
27
26
"github.com/arduino/arduino-cli/commands"
28
27
sk "github.com/arduino/arduino-cli/commands/sketch"
29
28
"github.com/arduino/arduino-cli/commands/upload"
@@ -90,7 +89,7 @@ func runUploadCommand(command *cobra.Command, args []string) {
90
89
feedback .Warning (msg )
91
90
}
92
91
93
- sk , err := sketch . New ( sketchPath )
92
+ sketch , err := sk . LoadSketch ( context . Background (), & rpc. LoadSketchRequest { SketchPath : sketchPath . String ()} )
94
93
if err != nil && importDir == "" && importFile == "" {
95
94
feedback .Fatal (tr ("Error during Upload: %v" , err ), feedback .ErrGeneric )
96
95
}
@@ -99,7 +98,7 @@ func runUploadCommand(command *cobra.Command, args []string) {
99
98
var profile * rpc.Profile
100
99
101
100
if profileArg .Get () == "" {
102
- inst , profile = instance .CreateAndInitWithProfile (sk . Project . DefaultProfile , sketchPath )
101
+ inst , profile = instance .CreateAndInitWithProfile (sketch . GetDefaultProfile (). GetName () , sketchPath )
103
102
} else {
104
103
inst , profile = instance .CreateAndInitWithProfile (profileArg .Get (), sketchPath )
105
104
}
@@ -108,8 +107,9 @@ func runUploadCommand(command *cobra.Command, args []string) {
108
107
fqbnArg .Set (profile .GetFqbn ())
109
108
}
110
109
111
- defaultFQBN := sk .GetDefaultFQBN ()
112
- defaultAddress , defaultProtocol := sk .GetDefaultPortAddressAndProtocol ()
110
+ defaultFQBN := sketch .GetDefaultFqbn ()
111
+ defaultAddress := sketch .GetDefaultPort ()
112
+ defaultProtocol := sketch .GetDefaultProtocol ()
113
113
fqbn , port := arguments .CalculateFQBNAndPort (& portArgs , & fqbnArg , inst , defaultFQBN , defaultAddress , defaultProtocol )
114
114
115
115
userFieldRes , err := upload .SupportedUserFields (context .Background (), & rpc.SupportedUserFieldsRequest {
0 commit comments