@@ -1468,6 +1468,9 @@ function Test-UnityProjectInstanceMetaFileIntegrity {
1468
1468
}
1469
1469
}
1470
1470
1471
+ # Derived from https://docs.unity3d.com/Manual/SpecialFolders.html
1472
+ $unityAssetExcludes = @ (' .*' , ' *~' , ' cvs' , ' *.tmp' )
1473
+
1471
1474
foreach ( $p in $Project ) {
1472
1475
1473
1476
$testResult = $true
@@ -1476,17 +1479,20 @@ function Test-UnityProjectInstanceMetaFileIntegrity {
1476
1479
$assetDir = Join-Path $p.Path " Assets"
1477
1480
1478
1481
# get all the directories under assets
1479
- [System.IO.DirectoryInfo []]$dirs = Get-ChildItem - Path " $assetDir /*" - Recurse - Directory - Exclude ' .*'
1482
+ [System.IO.DirectoryInfo []]$dirs =
1483
+ Get-ChildItem - Path " $assetDir /*" - Recurse - Directory - Exclude $unityAssetExcludes
1480
1484
1481
1485
Write-Verbose " Testing asset directories for missing meta files..."
1482
1486
[float ]$progressCounter = 0
1483
1487
foreach ($dir in $dirs ) {
1484
1488
1489
+ ++ $progressCounter
1485
1490
$progress = @ {
1486
1491
' Activity' = " Testing directories for missing meta files"
1487
- ' Status' = $ dir
1488
- ' PercentComplete' = ((( ++ $progressCounter ) / $dirs.Length ) * 100 )
1492
+ ' Status' = " $progressCounter / $ ( $dirs .Length ) - $ dir"
1493
+ ' PercentComplete' = (($progressCounter / $dirs.Length ) * 100 )
1489
1494
}
1495
+ Write-Debug $progress.Status
1490
1496
Write-Progress @progress
1491
1497
1492
1498
$testPath = " $ ( $dir.FullName ) .meta" ;
@@ -1507,20 +1513,24 @@ function Test-UnityProjectInstanceMetaFileIntegrity {
1507
1513
if (-not $testResult ) { $false ; continue ; }
1508
1514
1509
1515
# get all the non-meta files under assets
1510
- [System.IO.FileInfo []]$files = Get-ChildItem - Path " $assetDir /*" - Exclude ' .*' , ' *.meta' - File
1516
+ $unityAssetFileExcludes = $unityAssetExcludes + ' *.meta'
1517
+ [System.IO.FileInfo []]$files = Get-ChildItem - Path " $assetDir /*" - Exclude $unityAssetFileExcludes - File
1511
1518
foreach ($dir in $dirs ) {
1512
- $files += Get-ChildItem - Path " $ ( $dir.FullName ) /*" - Exclude ' .* ' , ' *.meta ' - File
1519
+ $files += Get-ChildItem - Path " $ ( $dir.FullName ) /*" - Exclude $unityAssetFileExcludes - File
1513
1520
}
1514
1521
1515
1522
Write-Verbose " Testing asset files for missing meta files..."
1516
1523
$progressCounter = 0
1517
1524
foreach ( $file in $files ) {
1518
1525
1526
+ ++ $progressCounter
1519
1527
$progress = @ {
1520
1528
' Activity' = " Testing files for missing meta files"
1521
- ' Status' = $file
1522
- ' PercentComplete' = (((++ $progressCounter ) / $files.Length ) * 100 )
1529
+ ' Status' = " $progressCounter / $ ( $files.Length ) - $file "
1530
+ ' PercentComplete' = (($progressCounter / $files.Length ) * 100 )
1531
+
1523
1532
}
1533
+ Write-Debug $progress.Status
1524
1534
Write-Progress @progress
1525
1535
1526
1536
$testPath = " $ ( $file.FullName ) .meta" ;
@@ -1541,7 +1551,7 @@ function Test-UnityProjectInstanceMetaFileIntegrity {
1541
1551
if (-not $testResult ) { $false ; continue ; }
1542
1552
1543
1553
$metaFileSearchArgs = @ {
1544
- ' Exclude' = ' .* '
1554
+ ' Exclude' = $unityAssetExcludes
1545
1555
' Include' = ' *.meta'
1546
1556
' File' = $true
1547
1557
' Force' = $true # Ensure we include hidden meta files
@@ -1557,11 +1567,13 @@ function Test-UnityProjectInstanceMetaFileIntegrity {
1557
1567
$progressCounter = 0
1558
1568
foreach ($metaFile in $metaFiles ) {
1559
1569
1570
+ ++ $progressCounter
1560
1571
$progress = @ {
1561
1572
' Activity' = " Testing meta files for missing assets"
1562
- ' Status' = $ metaFile
1563
- ' PercentComplete' = ((( ++ $progressCounter ) / $metaFiles.Length ) * 100 )
1573
+ ' Status' = " $progressCounter / $ ( $metaFiles .Length ) - $ metaFile"
1574
+ ' PercentComplete' = (($progressCounter / $metaFiles.Length ) * 100 )
1564
1575
}
1576
+ Write-Debug $progress.Status
1565
1577
Write-Progress @progress
1566
1578
1567
1579
$testPath = $metaFile.FullName.SubString (0 , $metaFile.FullName.Length - $metaFile.Extension.Length );
@@ -1586,11 +1598,13 @@ function Test-UnityProjectInstanceMetaFileIntegrity {
1586
1598
$progressCounter = 0
1587
1599
foreach ($metaFile in $metaFiles ) {
1588
1600
1601
+ ++ $progressCounter
1589
1602
$progress = @ {
1590
1603
' Activity' = " Testing meta files for guid collisions"
1591
- ' Status' = $ metaFile
1592
- ' PercentComplete' = ((( ++ $progressCounter ) / $metaFiles.Length ) * 100 )
1604
+ ' Status' = " $progressCounter / $ ( $metaFiles .Length ) - $ metaFile"
1605
+ ' PercentComplete' = (($progressCounter / $metaFiles.Length ) * 100 )
1593
1606
}
1607
+ Write-Debug $progress.Status
1594
1608
Write-Progress @progress
1595
1609
1596
1610
try {
0 commit comments