更新到第二十三章

This commit is contained in:
2026-07-19 22:11:42 +08:00
parent cc5b799443
commit 31357edfd2
19 changed files with 5765 additions and 43 deletions

View File

@@ -0,0 +1,33 @@
param(
[Parameter(Mandatory = $true, ValueFromRemainingArguments = $true)]
[string[]] $Path
)
$failed = $false
foreach ($chapterPath in $Path) {
if (-not (Test-Path -LiteralPath $chapterPath -PathType Leaf)) {
Write-Error "File not found: $chapterPath"
$failed = $true
continue
}
$text = Get-Content -LiteralPath $chapterPath -Raw -Encoding UTF8
$body = ($text -split '\*\*\*\*', 2)[0]
$withoutWhitespace = $body -replace '\s', ''
$count = $withoutWhitespace.Length
[pscustomobject]@{
Chapter = [IO.Path]::GetFileNameWithoutExtension($chapterPath)
BodyCharactersWithoutWhitespace = $count
MeetsFiveThousand = ($count -ge 5000)
}
if ($count -lt 5000) {
$failed = $true
}
}
if ($failed) {
exit 1
}