Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

ChocolateyInstall.ps1 should use a known environment variable instead of a hard coded path #38

Merged
merged 1 commit into from

2 participants

Rob Reynolds Damian Hickey
Rob Reynolds

This fixes errors with the current package when attempting to install from chocolatey. Also wrapped in a try/catch and removed the 6 second sleep time that is no longer necessary.

Rob Reynolds ferventcoder wrapping the chocolateyInstall in a try catch and changing the path t…
…o chocolatey install to use the environment variable ($env:ChocolateyInstall)
7e69548
Damian Hickey damianh merged commit 7e69548 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 6, 2012
  1. Rob Reynolds

    wrapping the chocolateyInstall in a try catch and changing the path t…

    ferventcoder authored
    …o chocolatey install to use the environment variable ($env:ChocolateyInstall)
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 11 deletions.
  1. +16 −11 nuget/tools/chocolateyInstall.ps1
27 nuget/tools/chocolateyInstall.ps1
View
@@ -1,14 +1,19 @@
-$nugetPath = 'C:\NuGet'
-$nugetExePath = Join-Path $nuGetPath 'bin'
-$packageBatchFileName = Join-Path $nugetExePath "psake.bat"
+try {
+ $nugetPath = $env:ChocolateyInstall
+ $nugetExePath = Join-Path $nuGetPath 'bin'
+ $packageBatchFileName = Join-Path $nugetExePath "psake.bat"
-$psakeDir = (Split-Path -parent $MyInvocation.MyCommand.Definition)
-#$path = ($psakeDir | Split-Path | Join-Path -ChildPath 'psake.cmd')
-$path = Join-Path $psakeDir 'psake.cmd'
-Write-Host "Adding $packageBatchFileName and pointing to $path"
-"@echo off
-""$path"" %*" | Out-File $packageBatchFileName -encoding ASCII
+ $psakeDir = (Split-Path -parent $MyInvocation.MyCommand.Definition)
+ #$path = ($psakeDir | Split-Path | Join-Path -ChildPath 'psake.cmd')
+ $path = Join-Path $psakeDir 'psake.cmd'
+ Write-Host "Adding $packageBatchFileName and pointing to $path"
+ "@echo off
+ ""$path"" %*" | Out-File $packageBatchFileName -encoding ASCII
+ write-host "PSake is now ready. You can type 'psake' from any command line at any path. Get started by typing 'psake /?'"
-write-host "PSake is now ready. You can type 'psake' from any command line at any path. Get started by typing 'psake /?'"
-Start-Sleep 6
+ Write-ChocolateySuccess 'psake'
+} catch {
+ Write-ChocolateyFailure 'psake' "$($_.Exception.Message)"
+ throw
+}
Something went wrong with that request. Please try again.