mirror of
https://github.com/thepeacockproject/Peacock
synced 2024-11-22 22:12:45 +01:00
Fixed issue where folders for cached images weren't properly created (#9)
This commit is contained in:
parent
76d6028c5e
commit
9affb237e3
@ -514,6 +514,7 @@ function startServer(options: { hmr: boolean; pluginDevHost: boolean }): void {
|
||||
join("userdata", "scpc", "steamids"),
|
||||
join("images", "actors"),
|
||||
join("images", "contracts"),
|
||||
join("images", "contracts", "elusive"),
|
||||
join("images", "contracts", "escalation"),
|
||||
join("images", "contracts", "featured"),
|
||||
join("images", "unlockables_override"),
|
||||
|
@ -70,6 +70,14 @@ export async function imageFetchingMiddleware(
|
||||
if (getFlag("imageLoading") === "SAVEASREQUESTED") {
|
||||
log(LogLevel.DEBUG, `Saving image ${path} to disk.`)
|
||||
|
||||
const dir = ppath.dirname(path as Filename)
|
||||
|
||||
if (!imageJailFs.existsSync(dir)) {
|
||||
log(LogLevel.DEBUG, `Creating missing directory ${dir}`)
|
||||
|
||||
imageJailFs.mkdirSync(dir, { recursive: true })
|
||||
}
|
||||
|
||||
const writeStream = imageJailFs.createWriteStream(
|
||||
ppath.resolve(path as Filename),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user