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
2
2
3
3
# Requires -Version 7.0
4
4
# Requires -PSEdition Core
@@ -61,11 +61,14 @@ $tempExe = Install-Standalone-Tool `
61
61
- Directory $tempInstallDirectory `
62
62
- Repository $Repository
63
63
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
+ }
65
67
$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
67
70
68
- Write-Host " Package $package is installed at $exe "
71
+ Write-Host " Package $package is installed at $exeDestination "
69
72
if (! $UpdatePathInProfile ) {
70
73
Write-Warning " To add the tool to PATH for new shell sessions, re-run with -UpdatePathInProfile to modify the shell profile file."
71
74
} else {
@@ -74,5 +77,5 @@ if (!$UpdatePathInProfile) {
74
77
}
75
78
76
79
if ($Run ) {
77
- Start-Process - WorkingDirectory $RunDirectory - FilePath $exe - ArgumentList ' start' - NoNewWindow - Wait
80
+ Start-Process - WorkingDirectory $RunDirectory - FilePath $exeDestination - ArgumentList ' start' - NoNewWindow - Wait
78
81
}
Original file line number Diff line number Diff line change @@ -247,6 +247,6 @@ function Add-InstallDirectoryToPathInProfile(
247
247
248
248
if (! $configContent -or ! $configContent.Contains ($markerComment )) {
249
249
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 )
251
251
}
252
- }
252
+ }
You can’t perform that action at this time.
0 commit comments