44 lines
1.3 KiB
PowerShell
44 lines
1.3 KiB
PowerShell
# Copy cover.png files from content/novels to public/images
|
|
$novelsWithCovers = @(
|
|
"astral-pet-store",
|
|
"emperors-domination",
|
|
"i-became-the-male-leads-adopted-daughter",
|
|
"infinite-mage-remake",
|
|
"my-disciples-are-all-villains",
|
|
"nano-machine",
|
|
"omniscient-readers-viewpoint",
|
|
"reaper-of-the-drifting-moon",
|
|
"reincarnation-of-the-strongest-sword-god",
|
|
"remarried-empress",
|
|
"silent-witch",
|
|
"the-eternal-supreme",
|
|
"the-great-mage-returns-after-4000-years",
|
|
"the-player-hides-his-past",
|
|
"the-steward-demonic-emperor",
|
|
"turns-out-im-in-a-villain-clan"
|
|
)
|
|
|
|
$baseDir = "c:\Users\a.dchar\Documents\privé\lab\lastwebnovel"
|
|
|
|
foreach ($slug in $novelsWithCovers) {
|
|
$sourceFile = Join-Path $baseDir "content\novels\$slug\cover.png"
|
|
$destDir = Join-Path $baseDir "public\images\$slug"
|
|
$destFile = Join-Path $destDir "cover.png"
|
|
|
|
# Create destination directory if it doesn't exist
|
|
if (!(Test-Path $destDir)) {
|
|
New-Item -ItemType Directory -Path $destDir -Force | Out-Null
|
|
Write-Host "Created directory: $destDir"
|
|
}
|
|
|
|
# Copy the file
|
|
if (Test-Path $sourceFile) {
|
|
Copy-Item -Path $sourceFile -Destination $destFile -Force
|
|
Write-Host "Copied: $slug/cover.png"
|
|
} else {
|
|
Write-Host "Source not found: $sourceFile"
|
|
}
|
|
}
|
|
|
|
Write-Host "Done!"
|