From: Edward Delaporte Date: Wed, 18 Dec 2019 21:14:56 +0000 (-0600) Subject: Cleverness to ensure my local profile gets sourced. X-Git-Url: https://apps.delaporte.us/gitweb/dotfiles.git/commitdiff_plain/e0b2c3216dddfd6696e44f38d44ef4ebae7f1a5b?hp=9481fec03eb79f943f7437ef57bc5134b46db4dd Cleverness to ensure my local profile gets sourced. --- diff --git a/Microsoft.PowerShell_profile.ps1 b/Microsoft.PowerShell_profile.ps1 index 46c9bdf..53a6fc4 100644 --- a/Microsoft.PowerShell_profile.ps1 +++ b/Microsoft.PowerShell_profile.ps1 @@ -1,3 +1,12 @@ # Path to Flutter -$ENV:PATH +=":/home/delaport/development/flutter/bin" # Kali under WSL \ No newline at end of file +$ENV:PATH +=":/home/delaport/development/flutter/bin" # Kali under WSL + +# Some Paths that are annoying to find/restore if the installer fails +$ENV:PATH+=";C:\Program Files\Python38\Scripts\;C:\Program Files\Python38\" +$ENV:PATH+=";C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Docker\Docker\Resources\bin" +$ENV:PATH+=";C:\Program Files (x86)\Common Files\Oracle\Java\javapath" +$ENV:PATH+=";C:\Program Files\Microsoft VS Code\bin" +$ENV:PATH+=";C:\Program Files\Git\cmd" +$ENV:PATH+=";C:\ProgramData\chocolatey\bin" +$ENV:PATH+=";C:\PENGUIN" # Flag to ensure my profile kicked in. \ No newline at end of file diff --git a/bootstrap.ps1 b/bootstrap.ps1 index 8cf3bf1..6377168 100644 --- a/bootstrap.ps1 +++ b/bootstrap.ps1 @@ -2,7 +2,13 @@ if(-Not(Test-Path -Path $profile)) { New-Item -Path "$profile" -ItemType File } -$sourceMeLine = "source $pwd/Microsoft.PowerShell_profile.ps1" +$sourceMeFile = "$pwd\Microsoft.PowerShell_profile.ps1" +$sourceMeLine = '$profileContents = [string]::join([environment]::newline, (get-content -path' +$sourceMeLine += $sourceMeFile +$sourceMeLine += '));invoke-expression $profileContents' + +Write-Host $sourceMeLine + $profileContents = Get-Content $profile if(! $profileContents -contains $sourceMeLine) { Add-Content -Path $profile -Value $sourceMeLine