File tree 2 files changed +11
-19
lines changed
2 files changed +11
-19
lines changed Original file line number Diff line number Diff line change @@ -18,14 +18,23 @@ package sketch
18
18
import (
19
19
"fmt"
20
20
21
- "github.com/arduino/arduino-cli/internal/arduino/sketch"
22
21
paths "github.com/arduino/go-paths-helper"
23
22
)
24
23
25
24
// WarnDeprecatedFiles warns the user that a type of sketch files are deprecated
26
25
func WarnDeprecatedFiles (sketchPath * paths.Path ) string {
26
+ if sketchPath .IsNotDir () {
27
+ sketchPath = sketchPath .Parent ()
28
+ }
29
+
30
+ files , err := sketchPath .ReadDirRecursive ()
31
+ if err != nil {
32
+ return ""
33
+ }
34
+ files .FilterSuffix (".pde" )
35
+
27
36
// .pde files are still supported but deprecated, this warning urges the user to rename them
28
- if files := sketch . CheckForPdeFiles ( sketchPath ); len (files ) > 0 {
37
+ if len (files ) > 0 {
29
38
msg := tr ("Sketches with .pde extension are deprecated, please rename the following files to .ino:" )
30
39
for _ , f := range files {
31
40
msg += fmt .Sprintf ("\n - %s" , f )
Original file line number Diff line number Diff line change @@ -280,23 +280,6 @@ func (e *InvalidSketchFolderNameError) Error() string {
280
280
return tr ("no valid sketch found in %[1]s: missing %[2]s" , e .SketchFolder , e .SketchFile )
281
281
}
282
282
283
- // CheckForPdeFiles returns all files ending with .pde extension
284
- // in sketch, this is mainly used to warn the user that these files
285
- // must be changed to .ino extension.
286
- // When .pde files won't be supported anymore this function must be removed.
287
- func CheckForPdeFiles (sketch * paths.Path ) []* paths.Path {
288
- if sketch .IsNotDir () {
289
- sketch = sketch .Parent ()
290
- }
291
-
292
- files , err := sketch .ReadDirRecursive ()
293
- if err != nil {
294
- return []* paths.Path {}
295
- }
296
- files .FilterSuffix (".pde" )
297
- return files
298
- }
299
-
300
283
// DefaultBuildPath generates the default build directory for a given sketch.
301
284
// The build path is in a temporary directory and is unique for each sketch.
302
285
func (s * Sketch ) DefaultBuildPath () * paths.Path {
You can’t perform that action at this time.
0 commit comments