Skip to content

Commit

Permalink
(GH-7) install - unpacking log debut output
Browse files Browse the repository at this point in the history
When set in debug mode, unpackself should also be called with `-dv`
  • Loading branch information
ferventcoder committed Feb 8, 2015
1 parent 889906a commit 82d2760
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions nuget/chocolatey/tools/chocolateysetup.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $sysDrive = $env:SystemDrive
$tempDir = $env:TEMP
$defaultChocolateyPathOld = "$sysDrive\Chocolatey"
$ErrorActionPreference = 'Stop'
$debugMode = $false

function Initialize-Chocolatey {
<#
Expand All @@ -30,9 +31,16 @@ function Initialize-Chocolatey {
param(
[Parameter(Mandatory=$false)][string]$chocolateyPath = ''
)
if ($env:ChocolateyEnvironmentDebug -ne $null) {
$debugMode = $true
}

$chocoNew = Join-Path $thisScriptFolder 'chocolateyInstall\choco.exe'
& $chocoNew unpackself --force
if ($debugMode) {
& $chocoNew unpackself -fdv
} else {
& $chocoNew unpackself -f
}

$installModule = Join-Path $thisScriptFolder 'chocolateyInstall\helpers\chocolateyInstaller.psm1'
Import-Module $installModule -Force
Expand Down Expand Up @@ -200,7 +208,12 @@ param(
$chocoExe = Join-Path $chocInstallFolder 'choco.exe'
$chocoExeDest = Join-Path $chocolateyPath 'choco.exe'
Copy-Item $chocoExe $chocoExeDest -force
& $chocoExeDest unpackself --force

if ($debugMode) {
& $chocoExeDest unpackself -fdv
} else {
& $chocoExeDest unpackself -f
}
}

function Ensure-ChocolateyLibFiles {
Expand Down

0 comments on commit 82d2760

Please sign in to comment.