File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 1- # !/bin/env pwsh
1+ # !/usr/ bin/env pwsh
22
33# Requires -Version 7.0
44# Requires -PSEdition Core
@@ -61,11 +61,14 @@ $tempExe = Install-Standalone-Tool `
6161 - Directory $tempInstallDirectory `
6262 - Repository $Repository
6363
64- Copy-Item - Path $tempExe - Destination $toolInstallDirectory - Force
64+ if (-not (Test-Path $toolInstallDirectory )) {
65+ New-Item - ItemType Directory - Path $toolInstallDirectory - Force | Out-Null
66+ }
6567$exeName = Split-Path $tempExe - Leaf
66- $exe = Join-Path $toolInstallDirectory $exeName
68+ $exeDestination = Join-Path $toolInstallDirectory $exeName
69+ Copy-Item - Path $tempExe - Destination $exeDestination - Force
6770
68- Write-Host " Package $package is installed at $exe "
71+ Write-Host " Package $package is installed at $exeDestination "
6972if (! $UpdatePathInProfile ) {
7073 Write-Warning " To add the tool to PATH for new shell sessions, re-run with -UpdatePathInProfile to modify the shell profile file."
7174} else {
@@ -74,5 +77,5 @@ if (!$UpdatePathInProfile) {
7477}
7578
7679if ($Run ) {
77- Start-Process - WorkingDirectory $RunDirectory - FilePath $exe - ArgumentList ' start' - NoNewWindow - Wait
80+ Start-Process - WorkingDirectory $RunDirectory - FilePath $exeDestination - ArgumentList ' start' - NoNewWindow - Wait
7881}
Original file line number Diff line number Diff line change @@ -247,6 +247,6 @@ function Add-InstallDirectoryToPathInProfile(
247247
248248 if (! $configContent -or ! $configContent.Contains ($markerComment )) {
249249 Write-Host " Adding installation to PATH in shell profile at '$configFile '"
250- Add-Content - Path $configFile - Value $pathCommand
250+ Add-Content - Path $configFile - Value ([ Environment ]::NewLine + $pathCommand )
251251 }
252- }
252+ }
You can’t perform that action at this time.
0 commit comments