fix updateseq not working in non-submodule folder
This commit is contained in:
@@ -186,9 +186,23 @@ function Add-SequenceFolder {
|
||||
[Parameter(Mandatory)] [System.IO.DirectoryInfo]$Directory,
|
||||
[Parameter(Mandatory)] [hashtable]$Map
|
||||
)
|
||||
if ($Directory.Name -eq '_archive') { return }
|
||||
if ($Directory.Name -like '_*') { return }
|
||||
$fullPath = $Directory.FullName
|
||||
if ($Map.ContainsKey($fullPath)) { return }
|
||||
|
||||
# Check if directory contains sequence files directly (not just subdirectories)
|
||||
$extensions = @('.png','.jpg','.jpeg','.exr','.tif','.tiff','.bmp','.tga')
|
||||
$hasSequenceFiles = Get-ChildItem -LiteralPath $fullPath -File -ErrorAction SilentlyContinue |
|
||||
Where-Object { $extensions -contains $_.Extension.ToLower() } |
|
||||
Select-Object -First 1
|
||||
|
||||
# If it only has subdirectories and no sequence files, skip it
|
||||
$hasSubdirs = Get-ChildItem -LiteralPath $fullPath -Directory -ErrorAction SilentlyContinue |
|
||||
Select-Object -First 1
|
||||
if ($null -eq $hasSequenceFiles -and $null -ne $hasSubdirs) {
|
||||
return
|
||||
}
|
||||
|
||||
$Map[$fullPath] = Resolve-SequenceName -Directory $Directory
|
||||
}
|
||||
|
||||
@@ -207,9 +221,9 @@ try {
|
||||
$secondaryPattern = if ($useIsoDailyFormat) { 'daily_*' } else { '????-??-??' }
|
||||
|
||||
$primaryDirs = Get-ChildItem -LiteralPath $root -Directory -Filter $primaryPattern -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.Name -ne '_archive' }
|
||||
Where-Object { $_.Name -notlike '_*' }
|
||||
foreach ($d in $primaryDirs) {
|
||||
$seqDirs = @(Get-ChildItem -LiteralPath $d.FullName -Directory -ErrorAction SilentlyContinue | Where-Object { $_.Name -ne '_archive' })
|
||||
$seqDirs = @(Get-ChildItem -LiteralPath $d.FullName -Directory -ErrorAction SilentlyContinue | Where-Object { $_.Name -notlike '_*' })
|
||||
if ($seqDirs.Count -eq 0) {
|
||||
Add-SequenceFolder -Directory $d -Map $sequenceMap
|
||||
} else {
|
||||
@@ -220,9 +234,9 @@ try {
|
||||
}
|
||||
|
||||
$secondaryDirs = Get-ChildItem -LiteralPath $root -Directory -Filter $secondaryPattern -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.Name -ne '_archive' }
|
||||
Where-Object { $_.Name -notlike '_*' }
|
||||
foreach ($d in $secondaryDirs) {
|
||||
$seqDirs = @(Get-ChildItem -LiteralPath $d.FullName -Directory -ErrorAction SilentlyContinue | Where-Object { $_.Name -ne '_archive' })
|
||||
$seqDirs = @(Get-ChildItem -LiteralPath $d.FullName -Directory -ErrorAction SilentlyContinue | Where-Object { $_.Name -notlike '_*' })
|
||||
if ($seqDirs.Count -eq 0) {
|
||||
Add-SequenceFolder -Directory $d -Map $sequenceMap
|
||||
} else {
|
||||
@@ -234,7 +248,7 @@ try {
|
||||
|
||||
$directSeqs = Get-ChildItem -LiteralPath $root -Directory -ErrorAction SilentlyContinue |
|
||||
Where-Object {
|
||||
$_.Name -ne '_archive' -and
|
||||
$_.Name -notlike '_*' -and
|
||||
$_.Name -notlike 'daily_*' -and
|
||||
$_.Name -notmatch '^\d{4}-\d{2}-\d{2}$'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user