Create data root if not exists in standalone mode

Supersedes #5217
This commit is contained in:
Cohee
2026-02-24 20:29:44 +02:00
parent 46f1d211e1
commit 334635ce74
+6 -2
View File
@@ -281,8 +281,12 @@ export class CommandLineParser {
const dataRoot = isGlobal
? defaultConfig.dataRoot
: (cliArguments.dataRoot ?? getConfigValue('dataRoot', defaultConfig.dataRoot));
if (isGlobal && !fs.existsSync(dataRoot)) {
fs.mkdirSync(dataRoot, { recursive: true });
try {
if (!fs.existsSync(dataRoot)) {
fs.mkdirSync(dataRoot, { recursive: true });
}
} catch (err) {
console.warn(color.yellow(`Warning: Failed to create data root directory at ${dataRoot}. Please make sure the path is correct and writable.`), err);
}
/** @type {CommandLineArguments} */