]> us-delaporte.pagekite.me Git - dotfiles.git/blobdiff - install/profile.ps1
Fixes to profile setup.
[dotfiles.git] / install / profile.ps1
index 2cd28a83abafb9df87a07e4cf4619f3acd29f2c6..d2d16b45c0692f3c4b090ed4f5fc7cbc59adbe03 100644 (file)
@@ -7,7 +7,6 @@ Setup EdTheDev's PowerShell Profile
 \r
 #>\r
 \r
 \r
 #>\r
 \r
-\r
 # Setup my PowerShell Profile (on Windows)\r
 if(-Not(Test-Path -Path $profile)) {\r
   New-Item -Path "$profile" -ItemType File\r
 # Setup my PowerShell Profile (on Windows)\r
 if(-Not(Test-Path -Path $profile)) {\r
   New-Item -Path "$profile" -ItemType File\r
@@ -19,12 +18,18 @@ $sourceMeLine = '$profileContents = [string]::join([environment]::newline, (get-
 $sourceMeLine += $sourceMeFile\r
 $sourceMeLine += '));invoke-expression $profileContents'\r
 \r
 $sourceMeLine += $sourceMeFile\r
 $sourceMeLine += '));invoke-expression $profileContents'\r
 \r
-$doneFlagFile = "./DONE.md"\r
-$doBootStrap = -Not (Test-Path -Path $doneFlagFile)\r
+# $doneFlagFile = "./DONE.md"\r
+# $doBootStrap = -Not (Test-Path -Path $doneFlagFile)\r
 \r
 \r
-$profileContents = Get-Content $profile \r
-if(! $profileContents -contains $sourceMeLine) {\r
-  Add-Content -Path $profile -Value $sourceMeLine\r
+$profileStuff = Get-Content -Path $profile \r
+if($profileStuff -Contains $sourceMeLine) {\r
+    Write-Host "Found profile source line: $sourceMeLine"\r
+    Write-Host "in file $profile"\r
+}\r
+else {\r
+    Write-Host "Profile source line will be added to $profile"\r
+    Add-Content -Path $profile -Value "" # Blank line to enforce newline.\r
+    Add-Content -Path $profile -Value $sourceMeLine\r
 }\r
 \r
 # Install profile for Windows Terminal\r
 }\r
 \r
 # Install profile for Windows Terminal\r