Skip to content

Commit 0fa6fc4

Browse files
committed
always warn the user about deprecated pde files
1 parent 0a4ff10 commit 0fa6fc4

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

cli/arguments/sketch.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,17 @@ func InitSketchPath(sketchPath string) *paths.Path {
4545

4646
// SketchPathCalculation returns the path and instance of the sketch and the discovery port.
4747
// Optionally, it warns the user when the sketch contains .pde files.
48-
func SketchPathCalculation(path string, port Port, instance *rpc.Instance, warn bool) (*paths.Path, *sketch.Sketch, *discovery.Port) {
49-
sketchPath := InitSketch(path, warn)
48+
func SketchPathCalculation(path string, port Port, instance *rpc.Instance) (*paths.Path, *sketch.Sketch, *discovery.Port) {
49+
sketchPath := InitSketch(path)
5050
sketch := CreateSketch(sketchPath)
5151
discoveryPort := GetDiscoveryPort(instance, port, sketch)
5252
return sketchPath, sketch, discoveryPort
5353
}
5454

5555
// InitSketch is a helper function that determines the sketch path. Optionally, it warns the user when the sketch contains .pde files.
56-
func InitSketch(path string, warn bool) *paths.Path {
56+
func InitSketch(path string) *paths.Path {
5757
sketchPath := InitSketchPath(path)
58-
59-
if warn {
60-
WarnDeprecatedFiles(sketchPath)
61-
}
58+
WarnDeprecatedFiles(sketchPath)
6259
return sketchPath
6360
}
6461

cli/debug/debug.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ 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, false)
77+
sketchPath, _, discoveryPort := arguments.SketchPathCalculation(path, port, instance)
7878
debugConfigRequested := &dbg.DebugConfigRequest{
7979
Instance: instance,
8080
Fqbn: fqbn.String(),

cli/upload/upload.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ 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, true)
79+
sketchPath, sk, discoveryPort := arguments.SketchPathCalculation(path, port, instance)
8080

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

0 commit comments

Comments
 (0)