From: EdTheDev Date: Sun, 3 Dec 2023 05:51:25 +0000 (-0600) Subject: Update for cross-platform X-Git-Url: https://apps.delaporte.us/gitweb/dotfiles.git/commitdiff_plain/428195aaba3bced2b7321b2553bebfeba9d01758 Update for cross-platform --- diff --git a/files/Microsoft.PowerShell_profile.ps1 b/files/Microsoft.PowerShell_profile.ps1 index c01ab27..14b1dc9 100644 --- a/files/Microsoft.PowerShell_profile.ps1 +++ b/files/Microsoft.PowerShell_profile.ps1 @@ -17,7 +17,9 @@ New-Alias dash Show-MyDashboard # from dash.psm1 New-Alias today Get-JournalAgenda # You can pry my unix commands out of my cold dead fingers -Set-Alias which get-command +if($iswindows) { + Set-Alias which get-command +} # Reject Windows heritage, act like Vi # Set-PSReadlineOption -HistorySavePath $env:src\PSHistory.log Set-PSReadlineOption -BellStyle Visual diff --git a/files/paths.ps1 b/files/paths.ps1 index b57e14a..c899256 100644 --- a/files/paths.ps1 +++ b/files/paths.ps1 @@ -4,7 +4,11 @@ function Add-ToPath { [switch]$Optional=$false ) if(Test-Path $Path){ - $ENV:PATH+=";$PATH" + if($iswindows) { + $ENV:PATH+=";$PATH" + } else { + $ENV:PATH+=":$PATH" + } } else { if(-Not $Optional) { Write-Error "Add-ToPath failed for $PATH" @@ -27,7 +31,7 @@ if($IsWindows){ } else { Add-ToPath "$env:src/bin" -optional # anything else I need - Add-ToPath "$HOME\bin" -optional # anything else I need + Add-ToPath "$HOME/bin" # anything else I need Add-ToPath "$HOME/x16/x16-emulator" -optional # x16 Emulator Add-ToPath "$HOME/src/x16-demo/tools" -optional # x16 python tools }