diff options
| author | ertopogo <erwin.t.pombett@gmail.com> | 2025-11-26 04:02:41 +0100 |
|---|---|---|
| committer | ertopogo <erwin.t.pombett@gmail.com> | 2025-11-26 04:02:41 +0100 |
| commit | fb7b2389c33bef903f236f4dd0c0b98dfc0bbbe8 (patch) | |
| tree | aa61a9026da508e865ab19b38677be523c961891 /scripts/cleanup-tridactyl.ps1 | |
| parent | 0f1ba5af1684cfc64b3ff5374ef95c70df1caac0 (diff) | |
Feat: Ajout de la configuration Tridactyl (Native Messenger + .tridactylrc) et scripts de maintenance
Diffstat (limited to 'scripts/cleanup-tridactyl.ps1')
| -rw-r--r-- | scripts/cleanup-tridactyl.ps1 | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/scripts/cleanup-tridactyl.ps1 b/scripts/cleanup-tridactyl.ps1 new file mode 100644 index 0000000..e1c3c7e --- /dev/null +++ b/scripts/cleanup-tridactyl.ps1 @@ -0,0 +1,34 @@ +# Script de nettoyage et consolidation Tridactyl +$ErrorActionPreference = "Stop" + +$sourceDir = "$env:USERPROFILE\.tridactyl" +$targetDir = "$env:APPDATA\Mozilla\NativeMessagingHosts" +$exeName = "native_main.exe" + +Write-Host "=== Consolidation Tridactyl ===" -ForegroundColor Cyan + +# 1. Copier l'exécutable +if (Test-Path "$sourceDir\$exeName") { + Write-Host "Copie de $exeName vers $targetDir..." + Copy-Item -Path "$sourceDir\$exeName" -Destination "$targetDir\$exeName" -Force + Write-Host "OK" -ForegroundColor Green +} else { + Write-Warning "$exeName non trouvé dans $sourceDir" +} + +# 2. Vérifier que tout est bien là-bas +if ((Test-Path "$targetDir\$exeName") -and (Test-Path "$targetDir\tridactyl.json")) { + Write-Host "Les fichiers nécessaires sont bien dans $targetDir" -ForegroundColor Green + + # 3. Supprimer l'ancien dossier + if (Test-Path $sourceDir) { + Write-Host "Suppression du dossier inutile $sourceDir..." + Remove-Item -Path $sourceDir -Recurse -Force + Write-Host "Dossier supprimé." -ForegroundColor Green + } +} else { + Write-Error "La copie semble avoir échoué. Le dossier source n'a pas été supprimé par sécurité." +} + +Write-Host "Opération terminée." -ForegroundColor Cyan + |
