Skip to content

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy