From c7d06a3ace4e216c9eb18f6e59bb67cf8a930bd4 Mon Sep 17 00:00:00 2001 From: Finessse Date: Sun, 28 Dec 2025 07:12:33 +0700 Subject: [PATCH] chore(scripts): add auth directory migration script PowerShell script to migrate auth files from legacy ~/.cli-proxy-api to new %LOCALAPPDATA%\ProxyPilot\auth location. --- migrate-auth.ps1 | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 migrate-auth.ps1 diff --git a/migrate-auth.ps1 b/migrate-auth.ps1 new file mode 100644 index 00000000..e16442cf --- /dev/null +++ b/migrate-auth.ps1 @@ -0,0 +1,25 @@ +# Migrate auth files from ~/.cli-proxy-api to %LOCALAPPDATA%\ProxyPilot\auth + +$oldDir = Join-Path $Env:USERPROFILE ".cli-proxy-api" +$newDir = Join-Path $Env:LOCALAPPDATA "ProxyPilot\auth" + +Write-Host "Migrating auth files..." +Write-Host " From: $oldDir" +Write-Host " To: $newDir" + +# Create new directory +if (-not (Test-Path $newDir)) { + New-Item -ItemType Directory -Path $newDir -Force | Out-Null + Write-Host "Created: $newDir" +} + +# Copy files +$files = Get-ChildItem $oldDir -Filter "*.json" -ErrorAction SilentlyContinue +foreach ($file in $files) { + $dest = Join-Path $newDir $file.Name + Copy-Item $file.FullName $dest -Force + Write-Host " Copied: $($file.Name)" +} + +Write-Host "`nMigration complete! $($files.Count) files copied." +Write-Host "New auth directory: $newDir"