From 636ec436eb152a2983cc40af63c8721638c997e3 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Wed, 3 Mar 2021 19:12:29 +0100 Subject: [PATCH] feat(pwsh): support 32 bit systems resolves #479 --- packages/powershell/oh-my-posh/deploy.ps1 | 2 +- packages/powershell/oh-my-posh/oh-my-posh.psm1 | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/powershell/oh-my-posh/deploy.ps1 b/packages/powershell/oh-my-posh/deploy.ps1 index c0ec67f4..ca624f7b 100644 --- a/packages/powershell/oh-my-posh/deploy.ps1 +++ b/packages/powershell/oh-my-posh/deploy.ps1 @@ -20,7 +20,7 @@ Param Copy-Item -Path "../../../themes" -Destination "./themes" -Recurse # fetch all the binaries from the version's GitHub release New-Item -Path "./" -Name "bin" -ItemType "directory" -"posh-windows-amd64.exe", "posh-darwin-amd64", "posh-linux-amd64" | ForEach-Object -Process { +"posh-windows-amd64.exe", "posh-windows-386.exe", "posh-darwin-amd64", "posh-linux-amd64" | ForEach-Object -Process { $download = "https://github.com/jandedobbeleer/oh-my-posh/releases/download/v$BinVersion/$_" Invoke-WebRequest $download -Out "./bin/$_" } diff --git a/packages/powershell/oh-my-posh/oh-my-posh.psm1 b/packages/powershell/oh-my-posh/oh-my-posh.psm1 index 67a9e7ab..67697641 100644 --- a/packages/powershell/oh-my-posh/oh-my-posh.psm1 +++ b/packages/powershell/oh-my-posh/oh-my-posh.psm1 @@ -4,14 +4,16 @@ #> function Get-PoshCommand { - $poshCommand = "$PSScriptRoot/bin/posh-windows-amd64.exe" if ($IsMacOS) { - $poshCommand = "$PSScriptRoot/bin/posh-darwin-amd64" + return "$PSScriptRoot/bin/posh-darwin-amd64" } if ($IsLinux) { - $poshCommand = "$PSScriptRoot/bin/posh-linux-amd64" + return "$PSScriptRoot/bin/posh-linux-amd64" } - return $poshCommand + if ([Environment]::Is64BitOperatingSystem) { + return "$PSScriptRoot/bin/posh-windows-amd64.exe" + } + return "$PSScriptRoot/bin/posh-windows-386.exe" } function Set-ExecutablePermissions {