From b43bd61ac69534e183bb6595bb0525c3320ed88d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 13:38:23 +0000 Subject: [PATCH] fix: ensure all required directories are created with recursive option on container rebuild Co-authored-by: whyour <22700758+whyour@users.noreply.github.com> --- back/loaders/initFile.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/back/loaders/initFile.ts b/back/loaders/initFile.ts index 2eab9446..e1c56060 100644 --- a/back/loaders/initFile.ts +++ b/back/loaders/initFile.ts @@ -18,8 +18,13 @@ const scriptPath = path.join(dataPath, 'scripts/'); const logPath = path.join(dataPath, 'log/'); const uploadPath = path.join(dataPath, 'upload/'); const bakPath = path.join(dataPath, 'bak/'); +const dbPath = path.join(dataPath, 'db/'); +const repoPath = path.join(dataPath, 'repo/'); +const rawPath = path.join(dataPath, 'raw/'); +const dependenceCachePath = path.join(dataPath, 'dep_cache/'); const samplePath = path.join(rootPath, 'sample/'); const tmpPath = path.join(logPath, '.tmp/'); +const updateLogPath = path.join(logPath, 'update/'); const confFile = path.join(configPath, 'config.sh'); const sampleConfigFile = path.join(samplePath, 'config.sample.sh'); const sampleTaskShellFile = path.join(samplePath, 'task.sample.sh'); @@ -44,11 +49,16 @@ const directories = [ preloadPath, logPath, tmpPath, + updateLogPath, uploadPath, sshPath, bakPath, sshdPath, systemLogPath, + dbPath, + repoPath, + rawPath, + dependenceCachePath, ]; const files = [ @@ -104,7 +114,7 @@ const files = [ export default async () => { for (const dirPath of directories) { if (!(await fileExist(dirPath))) { - await fs.mkdir(dirPath); + await fs.mkdir(dirPath, { recursive: true }); } }