Skip to content

Commit 657d4f3

Browse files
committed
remove prefix changes
1 parent ca8a2c5 commit 657d4f3

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

eng/scripts/get-aspire-cli.ps1

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
Pass a specific version to get CLI for that version.
1818
1919
.PARAMETER InstallPath
20-
Directory prefix to install (default: %USERPROFILE%\.aspire on Windows, $HOME/.aspire on Unix)
21-
CLI will be installed to InstallPath\bin (or InstallPath/bin on Unix)
20+
Directory to install the CLI (default: %USERPROFILE%\.aspire\bin on Windows, `$HOME/.aspire/bin on Unix)
2221
2322
.PARAMETER Version
2423
Version of the Aspire CLI to download (default: unset)
@@ -61,6 +60,7 @@
6160
iex "& { $(irm https://aka.ms/aspire/get/install.ps1) }"
6261
6362
.EXAMPLE
63+
# Piped execution
6464
iex "& { $(irm https://aka.ms/aspire/get/install.ps1) } -Quality staging"
6565
6666
.NOTES
@@ -77,7 +77,7 @@
7777

7878
[CmdletBinding(SupportsShouldProcess)]
7979
param(
80-
[Parameter(HelpMessage = "Directory prefix to install")]
80+
[Parameter(HelpMessage = "Directory to install the CLI")]
8181
[string]$InstallPath = "",
8282

8383
[Parameter(HelpMessage = "Version of the Aspire CLI to download")]
@@ -422,22 +422,22 @@ function Expand-AspireCliArchive {
422422
}
423423

424424
# Simplified installation path determination
425-
function Get-InstallPrefix {
425+
function Get-InstallPath {
426426
[CmdletBinding()]
427427
[OutputType([string])]
428428
param(
429429
[Parameter()]
430-
[string]$InstallPrefix
430+
[string]$InstallPath
431431
)
432432

433-
if (-not [string]::IsNullOrWhiteSpace($InstallPrefix)) {
433+
if (-not [string]::IsNullOrWhiteSpace($InstallPath)) {
434434
# Validate that the path is not just whitespace and can be created
435435
try {
436-
$resolvedPath = [System.IO.Path]::GetFullPath($InstallPrefix)
436+
$resolvedPath = [System.IO.Path]::GetFullPath($InstallPath)
437437
return $resolvedPath
438438
}
439439
catch {
440-
throw "Invalid installation path: $InstallPrefix - $($_.Exception.Message)"
440+
throw "Invalid installation path: $InstallPath - $($_.Exception.Message)"
441441
}
442442
}
443443

@@ -918,31 +918,28 @@ function Start-AspireCliInstallation {
918918
}
919919

920920
# Determine the installation path
921-
$resolvedInstallPrefix = Get-InstallPrefix -InstallPrefix $InstallPath
921+
$resolvedInstallPath = Get-InstallPath -InstallPath $InstallPath
922922

923923
# Ensure the installation directory exists
924-
if (-not (Test-Path $resolvedInstallPrefix)) {
925-
Write-Message "Creating installation directory: $resolvedInstallPrefix" -Level Info
926-
if ($PSCmdlet.ShouldProcess($resolvedInstallPrefix, "Create installation directory")) {
924+
if (-not (Test-Path $resolvedInstallPath)) {
925+
Write-Message "Creating installation directory: $resolvedInstallPath" -Level Info
926+
if ($PSCmdlet.ShouldProcess($resolvedInstallPath, "Create installation directory")) {
927927
try {
928-
New-Item -ItemType Directory -Path $resolvedInstallPrefix -Force | Out-Null
928+
New-Item -ItemType Directory -Path $resolvedInstallPath -Force | Out-Null
929929
}
930930
catch {
931-
throw "Failed to create installation directory: $resolvedInstallPrefix - $($_.Exception.Message)"
931+
throw "Failed to create installation directory: $resolvedInstallPath - $($_.Exception.Message)"
932932
}
933933
}
934934
}
935935

936-
# Set CLI installation path
937-
$cliBinDir = Join-Path $resolvedInstallPrefix "bin"
938-
939936
$rid = Get-RuntimeIdentifier -_OS $OS -_Architecture $Architecture
940937

941938
# Download and install the Aspire CLI
942-
Install-AspireCli -CliBinDir $cliBinDir -Version $Version -Quality $Quality -TargetRID $rid
939+
Install-AspireCli -CliBinDir $resolvedInstallPath -Version $Version -Quality $Quality -TargetRID $rid
943940

944941
# Update PATH environment variables
945-
Update-PathEnvironment -CliBinDir $cliBinDir
942+
Update-PathEnvironment -CliBinDir $resolvedInstallPath
946943
}
947944
catch {
948945
# Log the full exception details if verbose

0 commit comments

Comments
 (0)