Fixed strategy files sorting by numbers (#8713)

This commit is contained in:
Matvey Beloded
2026-01-07 20:50:59 +07:00
committed by GitHub
parent a1bae719ce
commit 4ecc348d55
2 changed files with 5 additions and 8 deletions

View File

@@ -203,13 +203,10 @@ set "LISTS_PATH=%~dp0lists\"
:: Searching for .bat files in current folder, except files that start with "service"
echo Pick one of the options:
set "count=0"
for %%f in (*.bat) do (
set "filename=%%~nxf"
if /i not "!filename:~0,7!"=="service" (
set /a count+=1
echo !count!. %%f
set "file!count!=%%f"
)
for /f "delims=" %%F in ('powershell -Command "Get-ChildItem -Filter '*.bat' | Where-Object { $_.Name -notlike 'service*' } | Sort-Object { [Regex]::Replace($_.Name, '\d+', { $args[0].Value.PadLeft(8, '0') }) } | ForEach-Object { $_.Name }"') do (
set /a count+=1
echo !count!. %%F
set "file!count!=%%F"
)
:: Choosing file

View File

@@ -384,7 +384,7 @@ $dpiTargets = Build-DpiTargets -CustomUrl $dpiCustomUrl
# Config
$targetDir = $rootDir
if (-not $targetDir) { $targetDir = Split-Path -Parent $MyInvocation.MyCommand.Path }
$batFiles = Get-ChildItem -Path $targetDir -Filter "*.bat" | Where-Object { $_.Name -notlike "service*" } | Sort-Object Name
$batFiles = Get-ChildItem -Path $targetDir -Filter "*.bat" | Where-Object { $_.Name -notlike "service*" } | Sort-Object { [Regex]::Replace($_.Name, "\d+", { $args[0].Value.PadLeft(8, "0") }) }
$globalResults = @()