Skip to content

Commit e5bbf9d

Browse files
committed
Made PackageManager.TempDir private
1 parent d0b2556 commit e5bbf9d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

arduino/cores/packagemanager/install_uninstall.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (pm *PackageManager) InstallPlatform(platformRelease *cores.PlatformRelease
3939

4040
// InstallPlatformInDirectory installs a specific release of a platform in a specific directory.
4141
func (pm *PackageManager) InstallPlatformInDirectory(platformRelease *cores.PlatformRelease, destDir *paths.Path) error {
42-
if err := platformRelease.Resource.Install(pm.DownloadDir, pm.TempDir, destDir); err != nil {
42+
if err := platformRelease.Resource.Install(pm.DownloadDir, pm.tempDir, destDir); err != nil {
4343
return errors.Errorf(tr("installing platform %[1]s: %[2]s"), platformRelease, err)
4444
}
4545
if d, err := destDir.Abs(); err == nil {
@@ -137,7 +137,7 @@ func (pm *PackageManager) InstallTool(toolRelease *cores.ToolRelease) error {
137137
"tools",
138138
toolRelease.Tool.Name,
139139
toolRelease.Version.String())
140-
return toolResource.Install(pm.DownloadDir, pm.TempDir, destDir)
140+
return toolResource.Install(pm.DownloadDir, pm.tempDir, destDir)
141141
}
142142

143143
// IsManagedToolRelease returns true if the ToolRelease is managed by the PackageManager

arduino/cores/packagemanager/package_manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type PackageManager struct {
4343
IndexDir *paths.Path
4444
PackagesDir *paths.Path
4545
DownloadDir *paths.Path
46-
TempDir *paths.Path
46+
tempDir *paths.Path
4747
CustomGlobalProperties *properties.Map
4848
profile *sketch.Profile
4949
discoveryManager *discoverymanager.DiscoveryManager
@@ -60,7 +60,7 @@ func NewPackageManager(indexDir, packagesDir, downloadDir, tempDir *paths.Path,
6060
IndexDir: indexDir,
6161
PackagesDir: packagesDir,
6262
DownloadDir: downloadDir,
63-
TempDir: tempDir,
63+
tempDir: tempDir,
6464
CustomGlobalProperties: properties.NewMap(),
6565
discoveryManager: discoverymanager.New(),
6666
userAgent: userAgent,

arduino/cores/packagemanager/profiles.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ func (pm *PackageManager) loadProfilePlatform(platformRef *sketch.ProfilePlatfor
8686

8787
func (pm *PackageManager) installMissingProfilePlatform(platformRef *sketch.ProfilePlatformReference, destDir *paths.Path, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB) error {
8888
// Instantiate a temporary package manager only for platform installation
89-
_ = pm.TempDir.MkdirAll()
90-
tmp, err := paths.MkTempDir(pm.TempDir.String(), "")
89+
_ = pm.tempDir.MkdirAll()
90+
tmp, err := paths.MkTempDir(pm.tempDir.String(), "")
9191
if err != nil {
9292
return fmt.Errorf("installing missing platform: could not create temp dir %s", err)
9393
}

0 commit comments

Comments
 (0)