ensure app data directory exists before spawning process
This commit is contained in:
parent
36c7913b6c
commit
4aebd6a087
|
|
@ -644,9 +644,12 @@ async function runApp(dir: string, port: number) {
|
|||
// Load env vars from TOES_DIR/env/
|
||||
const appEnv = loadAppEnv(dir, TOES_DIR)
|
||||
|
||||
const dataDir = join(process.env.DATA_DIR ?? '.', 'toes', dir)
|
||||
mkdirSync(dataDir, { recursive: true })
|
||||
|
||||
const proc = Bun.spawn(['bun', 'run', 'toes'], {
|
||||
cwd,
|
||||
env: { ...process.env, ...appEnv, PORT: String(port), NO_AUTOPORT: 'true', APP_URL: buildAppUrl(dir, TOES_URL), APPS_DIR, DATA_DIR: join(process.env.DATA_DIR ?? '.', 'toes', dir), TOES_DIR, TOES_URL },
|
||||
env: { ...process.env, ...appEnv, PORT: String(port), NO_AUTOPORT: 'true', APP_URL: buildAppUrl(dir, TOES_URL), APPS_DIR, DATA_DIR: dataDir, TOES_DIR, TOES_URL },
|
||||
stdout: 'pipe',
|
||||
stderr: 'pipe',
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user