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