diff --git a/.licenses/go/github.com/arduino/go-paths-helper.dep.yml b/.licenses/go/github.com/arduino/go-paths-helper.dep.yml index 53141215dab..85c69a85427 100644 --- a/.licenses/go/github.com/arduino/go-paths-helper.dep.yml +++ b/.licenses/go/github.com/arduino/go-paths-helper.dep.yml @@ -1,8 +1,8 @@ --- name: github.com/arduino/go-paths-helper -version: v1.8.0 +version: v1.9.0 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/arduino/go-paths-helper license: gpl-2.0-or-later licenses: diff --git a/arduino/cores/packagemanager/install_uninstall.go b/arduino/cores/packagemanager/install_uninstall.go index 112faea8340..ca18e794cd1 100644 --- a/arduino/cores/packagemanager/install_uninstall.go +++ b/arduino/cores/packagemanager/install_uninstall.go @@ -265,10 +265,7 @@ func (pme *Explorer) IsManagedPlatformRelease(platformRelease *cores.PlatformRel if packagesDir.FollowSymLink() != nil { return false } - managed, err := installDir.IsInsideDir(packagesDir) - if err != nil { - return false - } + managed := installDir.IsInsideDir(packagesDir) return managed } @@ -371,10 +368,7 @@ func (pme *Explorer) IsManagedToolRelease(toolRelease *cores.ToolRelease) bool { if packagesDir.FollowSymLink() != nil { return false } - managed, err := installDir.IsInsideDir(packagesDir) - if err != nil { - return false - } + managed := installDir.IsInsideDir(packagesDir) return managed } diff --git a/arduino/sketch/sketch.go b/arduino/sketch/sketch.go index 9bc725a022f..07dd06a0dff 100644 --- a/arduino/sketch/sketch.go +++ b/arduino/sketch/sketch.go @@ -135,7 +135,7 @@ func New(path *paths.Path) (*Sketch, error) { } else if _, found := globals.AdditionalFileValidExtensions[ext]; found { // If the user exported the compiles binaries to the Sketch "build" folder // they would be picked up but we don't want them, so we skip them like so - if isInBuildFolder, err := p.IsInsideDir(sketch.FullPath.Join("build")); isInBuildFolder || err != nil { + if p.IsInsideDir(sketch.FullPath.Join("build")) { continue } diff --git a/commands/compile/compile.go b/commands/compile/compile.go index 72c476daf6a..3fd155443f8 100644 --- a/commands/compile/compile.go +++ b/commands/compile/compile.go @@ -131,9 +131,7 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream var buildPath *paths.Path if buildPathArg := req.GetBuildPath(); buildPathArg != "" { buildPath = paths.New(req.GetBuildPath()).Canonical() - if in, err := buildPath.IsInsideDir(sk.FullPath); err != nil { - return nil, &arduino.NotFoundError{Message: tr("Cannot find build path"), Cause: err} - } else if in && buildPath.IsDir() { + if in := buildPath.IsInsideDir(sk.FullPath); in && buildPath.IsDir() { if sk.AdditionalFiles, err = removeBuildFromSketchFiles(sk.AdditionalFiles, buildPath); err != nil { return nil, err } @@ -385,9 +383,7 @@ func removeBuildFromSketchFiles(files paths.PathList, build *paths.Path) (paths. var res paths.PathList ignored := false for _, file := range files { - if in, err := file.IsInsideDir(build); err != nil { - return nil, &arduino.NotFoundError{Message: tr("Cannot find build path"), Cause: err} - } else if !in { + if !file.IsInsideDir(build) { res = append(res, file) } else if !ignored { ignored = true diff --git a/go.mod b/go.mod index f08a4a0e58c..9fe5a6ce5ae 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ go 1.20 replace github.com/mailru/easyjson => github.com/cmaglie/easyjson v0.8.1 require ( - github.com/arduino/go-paths-helper v1.8.0 + github.com/arduino/go-paths-helper v1.9.0 github.com/arduino/go-properties-orderedmap v1.7.1 github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b github.com/arduino/go-win32-utils v0.0.0-20180330194947-ed041402e83b diff --git a/go.sum b/go.sum index 6e5272a3198..da175b313e3 100644 --- a/go.sum +++ b/go.sum @@ -45,8 +45,8 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= -github.com/arduino/go-paths-helper v1.8.0 h1:BfA1bq1XktnlqwfUDCoKbUqB3YFPe6X7szPSZj6Rdpk= -github.com/arduino/go-paths-helper v1.8.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU= +github.com/arduino/go-paths-helper v1.9.0 h1:IjWhDSF24n5bK/30NyApmzoVH9brWzc52KNPpBsRmMc= +github.com/arduino/go-paths-helper v1.9.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU= github.com/arduino/go-properties-orderedmap v1.7.1 h1:HQ9Pn/mk3+XyfrE39EEvaZwJkrvgiVSY5Oq3JSEfOR4= github.com/arduino/go-properties-orderedmap v1.7.1/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk= github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b h1:9hDi4F2st6dbLC3y4i02zFT5quS4X6iioWifGlVwfy4=