Skip to content

Commit

Permalink
(GH-274) nuget: Clean up how debugMode is expressed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
smspillaz committed May 7, 2015
1 parent 92a1621 commit 5ab9c05
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions nuget/chocolatey/tools/chocolateysetup.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $sysDrive = $env:SystemDrive
$tempDir = $env:TEMP
$defaultChocolateyPathOld = "$sysDrive\Chocolatey"
#$ErrorActionPreference = 'Stop'
$debugMode = $false
$debugModeParams = ""

function Initialize-Chocolatey {
<#
Expand Down Expand Up @@ -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

This comment has been minimized.

Copy link
@ferventcoder

ferventcoder May 7, 2015

Member

I believe unpackself is called two times. :)


$installModule = Join-Path $thisScriptFolder 'chocolateyInstall\helpers\chocolateyInstaller.psm1'
Import-Module $installModule -Force
Expand Down

1 comment on commit 5ab9c05

@ferventcoder
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We got to get nuget out of your vocabulary ;)

Please sign in to comment.