# Desfaz o entrar.ps1 para o usuario atual (Windows). Idempotente. NAO revoga o token no servidor: # apague-o em /user/settings/applications (Configuracoes > Aplicacoes). param([string]$Url) $ErrorActionPreference = 'Stop' if ($Url) { $env:DSGIT_URL = $Url } if (Test-Path $PROFILE) { # tira so o bloco do dsgit $atual = Get-Content $PROFILE -Raw -Encoding UTF8 if ($atual -match '# >>> dsgit ') { $novo = [regex]::Replace($atual, '(?s)\r?\n?# >>> dsgit .*?# <<< dsgit <<<\r?\n?', '').TrimEnd() if ($novo) { Set-Content -Path $PROFILE -Value "$novo`r`n" -Encoding UTF8 -NoNewline } else { Remove-Item $PROFILE } } } $git = (Get-Command git -ErrorAction SilentlyContinue | Select-Object -First 1).Source if (-not $git) { throw 'Git for Windows nao encontrado; o restante (cofre, git, MCP, ~/.dsgit) nao foi desfeito.' } & (Join-Path (Split-Path (Split-Path $git)) 'bin\bash.exe') (($PSScriptRoot -replace '\\', '/') + '/sair.sh') exit $LASTEXITCODE