mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Fix build module for removal of Platform module
This commit is contained in:
1 parent
bcdad12c04
commit
13e0760e16
1 file changed
+11
-9
@@ -1,7 +1,5 @@
|
|||||||
# Use the .NET Core APIs to determine the current platform; if a runtime
|
# Use the .NET Core APIs to determine the current platform; if a runtime
|
||||||
# exception is thrown, we are on FullCLR, not .NET Core.
|
# exception is thrown, we are on FullCLR, not .NET Core.
|
||||||
#
|
|
||||||
# TODO: import Microsoft.PowerShell.Platform instead
|
|
||||||
try {
|
try {
|
||||||
$Runtime = [System.Runtime.InteropServices.RuntimeInformation]
|
$Runtime = [System.Runtime.InteropServices.RuntimeInformation]
|
||||||
$OSPlatform = [System.Runtime.InteropServices.OSPlatform]
|
$OSPlatform = [System.Runtime.InteropServices.OSPlatform]
|
||||||
@@ -10,11 +8,15 @@ try {
|
|||||||
$IsLinux = $Runtime::IsOSPlatform($OSPlatform::Linux)
|
$IsLinux = $Runtime::IsOSPlatform($OSPlatform::Linux)
|
||||||
$IsOSX = $Runtime::IsOSPlatform($OSPlatform::OSX)
|
$IsOSX = $Runtime::IsOSPlatform($OSPlatform::OSX)
|
||||||
$IsWindows = $Runtime::IsOSPlatform($OSPlatform::Windows)
|
$IsWindows = $Runtime::IsOSPlatform($OSPlatform::Windows)
|
||||||
} catch [System.Management.Automation.RuntimeException] {
|
} catch {
|
||||||
$IsCore = $false
|
# If these are already set, then they're read-only and we're done
|
||||||
$IsLinux = $false
|
try {
|
||||||
$IsOSX = $false
|
$IsCore = $false
|
||||||
$IsWindows = $true
|
$IsLinux = $false
|
||||||
|
$IsOSX = $false
|
||||||
|
$IsWindows = $true
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -122,9 +124,9 @@ function Start-PSBuild {
|
|||||||
|
|
||||||
# FullCLR only builds a library, so there is no runtime component
|
# FullCLR only builds a library, so there is no runtime component
|
||||||
if ($FullCLR) {
|
if ($FullCLR) {
|
||||||
$script:Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $Executable)
|
$script:Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $Executable)
|
||||||
} else {
|
} else {
|
||||||
$script:Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $Runtime, $Executable)
|
$script:Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $Runtime, $Executable)
|
||||||
}
|
}
|
||||||
Write-Verbose "script:Output is $script:Output"
|
Write-Verbose "script:Output is $script:Output"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user