-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreplace_structure.ps1
More file actions
47 lines (40 loc) · 1.31 KB
/
Copy pathreplace_structure.ps1
File metadata and controls
47 lines (40 loc) · 1.31 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
# PowerShell script to replace the old structure with the new one
# Create a backup directory
$backupDir = "backup_old_structure"
New-Item -Path $backupDir -ItemType Directory -Force | Out-Null
Write-Host "Created backup directory: $backupDir"
# Move the old files to backup
Write-Host "Moving old files to backup..."
# List of directories and files to back up
$itemsToBackup = @(
"vigilance_system",
"tests",
"examples",
"config.yaml",
"requirements.txt",
"setup.py",
"setup.sh",
"setup.bat",
"download_sample_videos.py",
"README.md",
"COMPONENTS_GUIDE.md",
"DEPENDENCIES.md"
)
foreach ($item in $itemsToBackup) {
if (Test-Path $item) {
Move-Item -Path $item -Destination "$backupDir/$item" -Force
Write-Host "Moved $item to backup"
}
}
# Move the new structure to the root
Write-Host "Moving new structure to root..."
$items = Get-ChildItem -Path "clean_structure" -Force
foreach ($item in $items) {
Move-Item -Path $item.FullName -Destination "." -Force
Write-Host "Moved $($item.Name) to root"
}
# Remove the empty clean_structure directory
Remove-Item -Path "clean_structure" -Force
Write-Host "Removed empty clean_structure directory"
Write-Host "Structure replacement complete!"
Write-Host "The old structure has been backed up to $backupDir"