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

Commit 6836ad6

Browse files
committed
fix: Allow build-path to different drive than the sketch
This issue is mainly seen on Windows Fix #2156
1 parent ad9ddb8 commit 6836ad6

File tree

6 files changed

+10
-20
lines changed

6 files changed

+10
-20
lines changed

‎.licenses/go/github.com/arduino/go-paths-helper.dep.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
name: github.com/arduino/go-paths-helper
3-
version: v1.8.0
3+
version: v1.9.0
44
type: go
5-
summary:
5+
summary:
66
homepage: https://pkg.go.dev/github.com/arduino/go-paths-helper
77
license: gpl-2.0-or-later
88
licenses:

‎arduino/cores/packagemanager/install_uninstall.go‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,7 @@ func (pme *Explorer) IsManagedPlatformRelease(platformRelease *cores.PlatformRel
265265
if packagesDir.FollowSymLink() != nil {
266266
return false
267267
}
268-
managed, err := installDir.IsInsideDir(packagesDir)
269-
if err != nil {
270-
return false
271-
}
268+
managed := installDir.IsInsideDir(packagesDir)
272269
return managed
273270
}
274271

@@ -371,10 +368,7 @@ func (pme *Explorer) IsManagedToolRelease(toolRelease *cores.ToolRelease) bool {
371368
if packagesDir.FollowSymLink() != nil {
372369
return false
373370
}
374-
managed, err := installDir.IsInsideDir(packagesDir)
375-
if err != nil {
376-
return false
377-
}
371+
managed := installDir.IsInsideDir(packagesDir)
378372
return managed
379373
}
380374

‎arduino/sketch/sketch.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func New(path *paths.Path) (*Sketch, error) {
135135
} else if _, found := globals.AdditionalFileValidExtensions[ext]; found {
136136
// If the user exported the compiles binaries to the Sketch "build" folder
137137
// they would be picked up but we don't want them, so we skip them like so
138-
if isInBuildFolder, err:=p.IsInsideDir(sketch.FullPath.Join("build")); isInBuildFolder||err!=nil {
138+
if p.IsInsideDir(sketch.FullPath.Join("build")) {
139139
continue
140140
}
141141

‎commands/compile/compile.go‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream
131131
var buildPath *paths.Path
132132
if buildPathArg := req.GetBuildPath(); buildPathArg != "" {
133133
buildPath = paths.New(req.GetBuildPath()).Canonical()
134-
if in, err := buildPath.IsInsideDir(sk.FullPath); err != nil {
135-
return nil, &arduino.NotFoundError{Message: tr("Cannot find build path"), Cause: err}
136-
} else if in && buildPath.IsDir() {
134+
if in := buildPath.IsInsideDir(sk.FullPath); in && buildPath.IsDir() {
137135
if sk.AdditionalFiles, err = removeBuildFromSketchFiles(sk.AdditionalFiles, buildPath); err != nil {
138136
return nil, err
139137
}
@@ -385,9 +383,7 @@ func removeBuildFromSketchFiles(files paths.PathList, build *paths.Path) (paths.
385383
var res paths.PathList
386384
ignored := false
387385
for _, file := range files {
388-
if in, err := file.IsInsideDir(build); err != nil {
389-
return nil, &arduino.NotFoundError{Message: tr("Cannot find build path"), Cause: err}
390-
} else if !in {
386+
if !file.IsInsideDir(build) {
391387
res = append(res, file)
392388
} else if !ignored {
393389
ignored = true

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ go 1.20
66
replace github.com/mailru/easyjson => github.com/cmaglie/easyjson v0.8.1
77

88
require (
9-
github.com/arduino/go-paths-helper v1.8.0
9+
github.com/arduino/go-paths-helper v1.9.0
1010
github.com/arduino/go-properties-orderedmap v1.7.1
1111
github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b
1212
github.com/arduino/go-win32-utils v0.0.0-20180330194947-ed041402e83b

‎go.sum‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo
4545
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
4646
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
4747
github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck=
48-
github.com/arduino/go-paths-helper v1.8.0 h1:BfA1bq1XktnlqwfUDCoKbUqB3YFPe6X7szPSZj6Rdpk=
49-
github.com/arduino/go-paths-helper v1.8.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU=
48+
github.com/arduino/go-paths-helper v1.9.0 h1:IjWhDSF24n5bK/30NyApmzoVH9brWzc52KNPpBsRmMc=
49+
github.com/arduino/go-paths-helper v1.9.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU=
5050
github.com/arduino/go-properties-orderedmap v1.7.1 h1:HQ9Pn/mk3+XyfrE39EEvaZwJkrvgiVSY5Oq3JSEfOR4=
5151
github.com/arduino/go-properties-orderedmap v1.7.1/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk=
5252
github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b h1:9hDi4F2st6dbLC3y4i02zFT5quS4X6iioWifGlVwfy4=

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /