File tree Expand file tree Collapse file tree 2 files changed +11
-19
lines changed
Expand file tree Collapse file tree 2 files changed +11
-19
lines changed Original file line number Diff line number Diff line change @@ -18,14 +18,23 @@ package sketch
1818import (
1919 "fmt"
2020
21- "github.com/arduino/arduino-cli/internal/arduino/sketch"
2221 paths "github.com/arduino/go-paths-helper"
2322)
2423
2524// WarnDeprecatedFiles warns the user that a type of sketch files are deprecated
2625func 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+
2736 // .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 {
2938 msg := tr ("Sketches with .pde extension are deprecated, please rename the following files to .ino:" )
3039 for _ , f := range files {
3140 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 {
280280 return tr ("no valid sketch found in %[1]s: missing %[2]s" , e .SketchFolder , e .SketchFile )
281281}
282282
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-
300283// DefaultBuildPath generates the default build directory for a given sketch.
301284// The build path is in a temporary directory and is unique for each sketch.
302285func (s * Sketch ) DefaultBuildPath () * paths.Path {
You can’t perform that action at this time.
0 commit comments