diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-20 22:31:41 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-20 22:32:14 +0800 |
| commit | ce77780ebcf548b0d823af7ae240364a56fa321a (patch) | |
| tree | 4f71b68f944b143c0e0af1010bf189719d6e834c /scripts/setup/windows/post_uninst.ps1 | |
| parent | ab6be7968b25afb57fc428695693484ad8576718 (diff) | |
Remove legacy jv and jvv binaries and related filesjvn_0.1.1
Diffstat (limited to 'scripts/setup/windows/post_uninst.ps1')
| -rw-r--r-- | scripts/setup/windows/post_uninst.ps1 | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/scripts/setup/windows/post_uninst.ps1 b/scripts/setup/windows/post_uninst.ps1 new file mode 100644 index 0000000..d5c898d --- /dev/null +++ b/scripts/setup/windows/post_uninst.ps1 @@ -0,0 +1,39 @@ +$profileContent = Get-Content $PROFILE -ErrorAction SilentlyContinue +if ($profileContent) { + $startMarker = "# JustEnoughVCS - Begin #" + $endMarker = "# JustEnoughVCS - End #" + $newContent = @() + $insideBlock = $false + $foundStart = $false + + foreach ($line in $profileContent) { + if ($line.Trim() -eq $startMarker) { + $insideBlock = $true + $foundStart = $true + continue + } + if ($line.Trim() -eq $endMarker) { + $insideBlock = $false + continue + } + if (-not $insideBlock) { + $newContent += $line + } + } + + if ($foundStart -and $insideBlock) { + $newContent = @() + $insideBlock = $false + foreach ($line in $profileContent) { + if ($line.Trim() -eq $startMarker) { + $insideBlock = $true + continue + } + if (-not $insideBlock) { + $newContent += $line + } + } + } + + $newContent | Set-Content $PROFILE +} |
