From: EdTheDev Date: Fri, 29 Jan 2021 15:33:12 +0000 (-0600) Subject: Fixes to profile setup. X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/commitdiff_plain/767189961092c3838f1345e6ea83deef12049d00?ds=inline Fixes to profile setup. --- diff --git a/install/profile.ps1 b/install/profile.ps1 index 2cd28a8..d2d16b4 100644 --- a/install/profile.ps1 +++ b/install/profile.ps1 @@ -7,7 +7,6 @@ Setup EdTheDev's PowerShell Profile #> - # Setup my PowerShell Profile (on Windows) if(-Not(Test-Path -Path $profile)) { New-Item -Path "$profile" -ItemType File @@ -19,12 +18,18 @@ $sourceMeLine = '$profileContents = [string]::join([environment]::newline, (get- $sourceMeLine += $sourceMeFile $sourceMeLine += '));invoke-expression $profileContents' -$doneFlagFile = "./DONE.md" -$doBootStrap = -Not (Test-Path -Path $doneFlagFile) +# $doneFlagFile = "./DONE.md" +# $doBootStrap = -Not (Test-Path -Path $doneFlagFile) -$profileContents = Get-Content $profile -if(! $profileContents -contains $sourceMeLine) { - Add-Content -Path $profile -Value $sourceMeLine +$profileStuff = Get-Content -Path $profile +if($profileStuff -Contains $sourceMeLine) { + Write-Host "Found profile source line: $sourceMeLine" + Write-Host "in file $profile" +} +else { + Write-Host "Profile source line will be added to $profile" + Add-Content -Path $profile -Value "" # Blank line to enforce newline. + Add-Content -Path $profile -Value $sourceMeLine } # Install profile for Windows Terminal