Skip to content

Commit

Permalink
fix: 添加输出目录创建异常处理,恢复为默认输出目录
Browse files Browse the repository at this point in the history
  • Loading branch information
云中君 committed Feb 3, 2024
1 parent cb56c70 commit 3e22f05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions electron/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ export function getConfig(def = false) {
}

if (!fs.existsSync(config.output)) {
fs.mkdirSync(config.output, { recursive: true });
tryCatch(() => fs.mkdirSync(config.output, { recursive: true }), null, () => {
config.output = DefaultConfig.output;
config.cacheDir = path.join(config.output, '.catch');
fs.mkdirSync(config.output, { recursive: true });
});
}

if (!fs.existsSync(config.cacheDir)) {
fs.mkdirSync(config.cacheDir, { recursive: true });
}

if (!fs.existsSync(config.output)) {
fs.mkdirSync(config.output, { recursive: true });
}

if (!fs.existsSync(config.staticDir)) {
fs.mkdirSync(config.staticDir, { recursive: true });
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yiyin",
"version": "1.4.1",
"version": "1.4.2",
"license": "MIT",
"type": "module",
"main": "dist-electron/main/index.js",
Expand Down

0 comments on commit 3e22f05

Please sign in to comment.