Skip to content

Commit a091fb1

Browse files
committed
remove SketchPathCalculation because it does too much unrelated things
1 parent 0fa6fc4 commit a091fb1

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

cli/arguments/sketch.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ func InitSketchPath(sketchPath string) *paths.Path {
4343
return wd
4444
}
4545

46-
// SketchPathCalculation returns the path and instance of the sketch and the discovery port.
47-
// Optionally, it warns the user when the sketch contains .pde files.
48-
func SketchPathCalculation(path string, port Port, instance *rpc.Instance) (*paths.Path, *sketch.Sketch, *discovery.Port) {
49-
sketchPath := InitSketch(path)
50-
sketch := CreateSketch(sketchPath)
51-
discoveryPort := GetDiscoveryPort(instance, port, sketch)
52-
return sketchPath, sketch, discoveryPort
53-
}
54-
5546
// InitSketch is a helper function that determines the sketch path. Optionally, it warns the user when the sketch contains .pde files.
5647
func InitSketch(path string) *paths.Path {
5748
sketchPath := InitSketchPath(path)

cli/debug/debug.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ func runDebugCommand(command *cobra.Command, args []string) {
7474
if len(args) > 0 {
7575
path = args[0]
7676
}
77-
sketchPath, _, discoveryPort := arguments.SketchPathCalculation(path, port, instance)
77+
78+
sketchPath := arguments.InitSketch(path)
79+
sk := arguments.CreateSketch(sketchPath)
80+
discoveryPort := arguments.GetDiscoveryPort(instance, port, sk)
81+
7882
debugConfigRequested := &dbg.DebugConfigRequest{
7983
Instance: instance,
8084
Fqbn: fqbn.String(),

cli/upload/upload.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ func runUploadCommand(command *cobra.Command, args []string) {
7676
if len(args) > 0 {
7777
path = args[0]
7878
}
79-
sketchPath, sk, discoveryPort := arguments.SketchPathCalculation(path, port, instance)
79+
80+
sketchPath := arguments.InitSketch(path)
81+
sk := arguments.CreateSketch(sketchPath)
82+
discoveryPort := arguments.GetDiscoveryPort(instance, port, sk)
8083

8184
if fqbn.String() == "" && sk != nil && sk.Metadata != nil {
8285
// If the user didn't specify an FQBN and a sketch.json file is present

0 commit comments

Comments
 (0)