Skip to content

Commit ee5c8c0

Browse files
committed
Provide core install suggestions only when compiling without profiles
1 parent 6915920 commit ee5c8c0

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

arduino/cores/packagemanager/profiles.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (pm *PackageManager) installMissingProfilePlatform(platformRef *sketch.Prof
8686
// TODO: TaskProgressCB
8787

8888
// Instantiate a temporary package manager only for platform installation
89-
tmp, err := paths.MkTempDir("", "")
89+
tmp, err := paths.MkTempDir(pm.TempDir.String(), "")
9090
if err != nil {
9191
return fmt.Errorf("installing missing platform: could not create temp dir %s", err)
9292
}

cli/compile/compile.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,12 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
292292
PlatformArchitecture: split[1],
293293
})
294294

295-
if platform != nil {
296-
feedback.Errorf(tr("Try running %s", fmt.Sprintf("`%s core install %s`", globals.VersionInfo.Application, platformErr.Platform)))
297-
} else {
298-
feedback.Errorf(tr("Platform %s is not found in any known index\nMaybe you need to add a 3rd party URL?", platformErr.Platform))
295+
if profileArg.String() == "" {
296+
if platform != nil {
297+
feedback.Errorf(tr("Try running %s", fmt.Sprintf("`%s core install %s`", globals.VersionInfo.Application, platformErr.Platform)))
298+
} else {
299+
feedback.Errorf(tr("Platform %s is not found in any known index\nMaybe you need to add a 3rd party URL?", platformErr.Platform))
300+
}
299301
}
300302
}
301303
os.Exit(errorcodes.ErrGeneric)

0 commit comments

Comments
 (0)