forked from chocolatey/choco
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* stable: (doc) update changelog/nuspec (chocolateyGH-631) Remove Get-BinRoot, Add Get-ToolsLocation (chocolateyGH-606) Check for License in User Profile (chocolateyGH-629) Install-ChocolateyInstallPackage Validate Parameters (doc) Update changelog/nuspec
- Loading branch information
Showing
8 changed files
with
102 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 0 additions & 61 deletions
61
src/chocolatey.resources/helpers/functions/Get-BinRoot.ps1
This file was deleted.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
src/chocolatey.resources/helpers/functions/Get-ToolsLocation.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Copyright 2011 - Present RealDimensions Software, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
function Get-ToolsLocation { | ||
Write-Debug "Running 'Get-ToolsLocation'"; | ||
$invocation = $MyInvocation | ||
if ($invocation -ne $null -and $invocation.InvocationName -ne $null -and $invocation.InvocationName.ToLower() -eq 'Get-BinRoot') { | ||
Write-Host "Get-BinRoot is going to be deprecated in v1 and removed in v2. It is being replaced with Get-ToolsLocation, however many packages no longer require a special separate directory since package folders no longer have versions on them. Some do though and should continue to use Get-ToolsLocation." | ||
} | ||
|
||
$toolsLocation = $env:ChocolateyToolsLocation | ||
|
||
if ($toolsLocation -eq $null) { | ||
$binRoot = $env:ChocolateyBinRoot | ||
$olderRoot = $env:chocolatey_bin_root | ||
|
||
if ($binRoot -eq $null -and $olderRoot -eq $null) { | ||
$toolsLocation = Join-Path $env:systemdrive 'tools' | ||
} else { | ||
if ($olderRoot -ne $null) { | ||
if ($binRoot -eq $null) { | ||
$binRoot = $olderRoot | ||
} | ||
Set-EnvironmentVariable -Name "chocolatey_bin_root" -Value '' -Scope User | ||
} | ||
|
||
$toolsLocation = $binRoot | ||
Set-EnvironmentVariable -Name "ChocolateyBinRoot" -Value '' -Scope User | ||
} | ||
} | ||
|
||
# Add a drive letter if one doesn't exist | ||
if (-not($toolsLocation -imatch "^\w:")) { | ||
$toolsLocation = join-path $env:systemdrive $toolsLocation | ||
} | ||
|
||
if (-not($env:ChocolateyToolsLocation -eq $toolsLocation)) { | ||
Set-EnvironmentVariable -Name "ChocolateyToolsLocation" -Value $toolsLocation -Scope User | ||
} | ||
|
||
return $toolsLocation | ||
} | ||
|
||
Set-Alias Get-BinRoot Get-ToolsLocation -Force -Scope Global -Option AllScope |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters