Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0980e39

Browse files
author
Roberto Sora
committed
use package feedback to print message
1 parent3da95f0 commit0980e39

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎arduino/builder/sketch.go‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"regexp"
2525
"strings"
2626

27-
"github.com/sirupsen/logrus"
27+
"github.com/arduino/arduino-cli/cli/feedback"
2828

2929
"github.com/arduino/arduino-cli/arduino/globals"
3030
"github.com/arduino/arduino-cli/arduino/sketch"
@@ -62,6 +62,7 @@ func SketchSaveItemCpp(item *sketch.Item, destPath string) error {
6262
}
6363

6464
// SimpleLocalWalk locally replaces filepath.Walk and/but goes through symlinks
65+
// detecting and skipping symlink loops
6566
funcSimpleLocalWalk(rootstring,walkFnfunc(pathstring,info os.FileInfo,errerror)error)error {
6667
info,err:=os.Stat(root)
6768

@@ -78,12 +79,13 @@ func SimpleLocalWalk(root string, walkFn func(path string, info os.FileInfo, err
7879
files,err:=ioutil.ReadDir(root)
7980
iferr==nil {
8081
for_,file:=rangefiles {
81-
dirFileInfo,_:=os.Lstat(filepath.Join(root+file.Name()))
82+
filePath:=filepath.Join(root,file.Name())
83+
dirFileInfo,_:=os.Lstat(filePath)
8284
if (dirFileInfo.Mode()&os.ModeSymlink==os.ModeSymlink)&&!shouldTraverse(root,dirFileInfo) {
83-
logrus.Warnf("Symlink loop detected in %s %s",root,file.Name())
85+
feedback.Printf("Symlink loop detectedand skippedin %s",filePath)
8486
continue
8587
}
86-
err=SimpleLocalWalk(filepath.Join(root+file.Name()),walkFn)
88+
err=SimpleLocalWalk(filePath,walkFn)
8789
iferr==filepath.SkipDir {
8890
returnnil
8991
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp