]> us-delaporte.pagekite.me Git - dotfiles.git/commitdiff
Update for cross-platform
authorEdTheDev <edward@delaporte.us>
Sun, 3 Dec 2023 05:51:25 +0000 (23:51 -0600)
committerEdTheDev <edward@delaporte.us>
Sun, 3 Dec 2023 05:51:25 +0000 (23:51 -0600)
files/Microsoft.PowerShell_profile.ps1
files/paths.ps1

index c01ab2717d98b017c056954c19b27d02265af008..14b1dc9b9a00231dd0effdce480f488e314f4309 100644 (file)
@@ -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
 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
 # Reject Windows heritage, act like Vi
 # Set-PSReadlineOption -HistorySavePath $env:src\PSHistory.log
 Set-PSReadlineOption -BellStyle Visual
index b57e14a1fa726670aaad4bb2e50e61c1d04ee294..c8992563103097be0cc795ed0a505fd9e95350db 100644 (file)
@@ -4,7 +4,11 @@ function Add-ToPath {
                [switch]$Optional=$false
     )
        if(Test-Path $Path){
                [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"
        } 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
 }
 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
 }
        Add-ToPath "$HOME/x16/x16-emulator" -optional # x16 Emulator
        Add-ToPath "$HOME/src/x16-demo/tools" -optional # x16 python tools
 }