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 667671a

Browse files
facchinmcmaglie
authored andcommitted
Avoid setting build_cache path if not specified
Fixes arduino/Arduino#9189 Also, creates the directory if nonexistent.
1 parent bc2846e commit 667671a

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

‎main.go‎

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -319,23 +319,19 @@ func main() {
319319
}
320320

321321
// FLAG_BUILD_CACHE
322-
buildCachePathUnquoted, err := gohasissues.Unquote(*buildCachePathFlag)
323-
if err != nil {
324-
printCompleteError(err)
325-
}
326-
buildCachePath := paths.New(buildCachePathUnquoted)
327-
if buildCachePath != nil {
328-
// TODO: mmmmhhh... this one looks like a bug, why check existence?
329-
if _, err := buildCachePath.Stat(); err != nil {
330-
fmt.Fprintln(os.Stderr, err)
331-
os.Exit(1)
332-
}
333-
334-
if err := buildCachePath.MkdirAll(); err != nil {
322+
if *buildCachePathFlag != "" {
323+
buildCachePathUnquoted, err := gohasissues.Unquote(*buildCachePathFlag)
324+
if err != nil {
335325
printCompleteError(err)
336326
}
327+
buildCachePath := paths.New(buildCachePathUnquoted)
328+
if buildCachePath != nil {
329+
if err := buildCachePath.MkdirAll(); err != nil {
330+
printCompleteError(err)
331+
}
332+
}
333+
ctx.BuildCachePath = buildCachePath
337334
}
338-
ctx.BuildCachePath = buildCachePath
339335

340336
// FLAG_VID_PID
341337
if *vidPidFlag != "" {

0 commit comments

Comments
(0)

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