summaryrefslogtreecommitdiff
path: root/scripts/cleanup-tridactyl.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/cleanup-tridactyl.ps1')
-rw-r--r--scripts/cleanup-tridactyl.ps134
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
+