Skip to content

Commit

Permalink
(chocolateyGH-590) Explicit Cache - No chocolatey subdirectory
Browse files Browse the repository at this point in the history
An explicit cache directory should not use a "chocolatey" subdirectory.
The use of the chocolatey subdirectory should only occur if choco uses
the TEMP location.
  • Loading branch information
ferventcoder committed Jan 29, 2016
1 parent b359372 commit cd21a68
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ param(

Write-Debug "Running 'Install-ChocolateyPackage' for $packageName with url:`'$url`', args: `'$silentArgs`', fileType: `'$fileType`', url64bit: `'$url64bit`', checksum: `'$checksum`', checksumType: `'$checksumType`', checksum64: `'$checksum64`', checksumType64: `'$checksumType64`', validExitCodes: `'$validExitCodes`' ";

$chocTempDir = Join-Path $env:TEMP "chocolatey"
$chocTempDir = $env:TEMP
$tempDir = Join-Path $chocTempDir "$packageName"
if ($env:packageVersion -ne $null) {$tempDir = Join-Path $tempDir "$env:packageVersion"; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ param(

$fileType = 'zip'

$chocTempDir = Join-Path $env:TEMP "chocolatey"
$chocTempDir = $env:TEMP
$tempDir = Join-Path $chocTempDir "$packageName"
if ($env:packageVersion -ne $null) {$tempDir = Join-Path $tempDir "$env:packageVersion"; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private static void set_machine_sources(ChocolateyConfiguration config, ConfigFi
private static void set_config_items(ChocolateyConfiguration config, ConfigFileSettings configFileSettings, IFileSystem fileSystem)
{
var cacheLocation = set_config_item(ApplicationParameters.ConfigSettings.CacheLocation, configFileSettings, string.IsNullOrWhiteSpace(configFileSettings.CacheLocation) ? string.Empty : configFileSettings.CacheLocation, "Cache location if not TEMP folder.");
config.CacheLocation = !string.IsNullOrWhiteSpace(cacheLocation) ? cacheLocation : fileSystem.get_temp_path(); // System.Environment.GetEnvironmentVariable("TEMP");
config.CacheLocation = !string.IsNullOrWhiteSpace(cacheLocation) ? cacheLocation : fileSystem.combine_paths(fileSystem.get_temp_path(), "chocolatey"); // System.Environment.GetEnvironmentVariable("TEMP");
if (string.IsNullOrWhiteSpace(config.CacheLocation))
{
config.CacheLocation = fileSystem.combine_paths(ApplicationParameters.InstallLocation, "temp");
Expand Down

0 comments on commit cd21a68

Please sign in to comment.