From 5ab9c0564c587130acbad751f0edf317586368f5 Mon Sep 17 00:00:00 2001 From: Sam Spilsbury Date: Thu, 7 May 2015 21:13:18 +0800 Subject: [PATCH] (GH-274) nuget: Clean up how debugMode is expressed Previously we had an if condition on debugMode, but it is more concise to just express it as a string appended to the list of options passed to choco. --- nuget/chocolatey/tools/chocolateysetup.psm1 | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/nuget/chocolatey/tools/chocolateysetup.psm1 b/nuget/chocolatey/tools/chocolateysetup.psm1 index d615b8ffc6..719cbb3bf7 100644 --- a/nuget/chocolatey/tools/chocolateysetup.psm1 +++ b/nuget/chocolatey/tools/chocolateysetup.psm1 @@ -4,7 +4,7 @@ $sysDrive = $env:SystemDrive $tempDir = $env:TEMP $defaultChocolateyPathOld = "$sysDrive\Chocolatey" #$ErrorActionPreference = 'Stop' -$debugMode = $false +$debugModeParams = "" function Initialize-Chocolatey { <# @@ -34,17 +34,13 @@ param( Write-Debug "Initialize-Chocolatey" if ($env:ChocolateyEnvironmentDebug -eq 'true') { - $debugMode = $true + $debugMode = "dv" } Install-DotNet4IfMissing $chocoNew = Join-Path $thisScriptFolder 'chocolateyInstall\choco.exe' - if ($debugMode) { - & $chocoNew unpackself -fdvy - } else { - & $chocoNew unpackself -fy - } + & $chocoNew unpackself -fy$debugModeParams $installModule = Join-Path $thisScriptFolder 'chocolateyInstall\helpers\chocolateyInstaller.psm1' Import-Module $installModule -Force