-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix-vscode-stability.ps1
More file actions
48 lines (39 loc) · 1.68 KB
/
Copy pathfix-vscode-stability.ps1
File metadata and controls
48 lines (39 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 🧹 Script de Nettoyage et Optimisation VS Code - HousyTunisia
Write-Host "🚀 Démarrage du nettoyage et optimisation VS Code..." -ForegroundColor Green
# Fonction pour afficher les étapes
function Write-Step {
param([string]$Message)
Write-Host "`n🔧 $Message" -ForegroundColor Cyan
}
# Fonction pour vérifier et supprimer un dossier/fichier
function Remove-SafelyIfExists {
param([string]$Path, [string]$Description)
if (Test-Path $Path) {
try {
Remove-Item -Recurse -Force $Path -ErrorAction Stop
Write-Host "✅ $Description supprimé : $Path" -ForegroundColor Green
}
catch {
Write-Host "⚠️ Erreur lors de la suppression de $Description : $($_.Exception.Message)" -ForegroundColor Yellow
}
}
else {
Write-Host "ℹ️ $Description non trouvé : $Path" -ForegroundColor Gray
}
}
Write-Step "Nettoyage des fichiers Visual Studio (.vs)"
Remove-SafelyIfExists ".vs" "Dossier Visual Studio"
Write-Step "Nettoyage des fichiers temporaires de build"
Remove-SafelyIfExists "dist" "Dossier dist"
Remove-SafelyIfExists "build" "Dossier build"
Remove-SafelyIfExists ".next" "Dossier .next"
Write-Step "Nettoyage des fichiers de cache"
Remove-SafelyIfExists "node_modules/.cache" "Cache node_modules"
Remove-SafelyIfExists ".cache" "Dossier cache"
Write-Step "Vérification de la structure .vscode"
if (!(Test-Path ".vscode")) {
New-Item -ItemType Directory -Path ".vscode" -Force
Write-Host "✅ Dossier .vscode créé" -ForegroundColor Green
}
Write-Step "Optimisation terminée"
Write-Host "🎉 Le projet HousyTunisia est maintenant optimisé pour VS Code !" -ForegroundColor Green