File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,15 @@ function Write-Info($text) { Write-Host " $text" -ForegroundColor Gray }
5454# Track issues
5555$issues = @ ()
5656
57+ function Test-WindowsHost {
58+ $isWindowsVariable = Get-Variable - Name IsWindows - ErrorAction SilentlyContinue
59+ if ($isWindowsVariable ) {
60+ return [bool ]$isWindowsVariable.Value
61+ }
62+
63+ return [System.Environment ]::OSVersion.Platform -eq [System.PlatformID ]::Win32NT
64+ }
65+
5766function ConvertTo-GitSafeDirectoryPath ($path ) {
5867 return ([System.IO.Path ]::GetFullPath($path ).TrimEnd(" \" ) -replace " \\" , " /" )
5968}
@@ -143,7 +152,7 @@ Write-Host @"
143152Write-Header " Checking Prerequisites"
144153
145154# Check OS
146- if ($ env: OS -ne " Windows_NT " ) {
155+ if (-not ( Test-WindowsHost ) ) {
147156 Write-Error " This project requires Windows"
148157 exit 1
149158}
You can’t perform that action at this time.
0 commit comments