Skip to content

Commit

Permalink
FIX: app.setPath()前にディレクトリを作成する
Browse files Browse the repository at this point in the history
  • Loading branch information
sabonerune committed Dec 21, 2022
1 parent eb3ad4d commit 0518b19
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ type SingleInstanceLockData = {
const isDevelopment = process.env.NODE_ENV !== "production";

// Electronの設定ファイルの保存場所を変更
app.setPath(
"userData",
path.join(app.getPath("appData"), `voicevox${isDevelopment ? "-dev" : ""}`)
const fixedUserDataDir = path.join(
app.getPath("appData"),
`voicevox${isDevelopment ? "-dev" : ""}`
);
if (!fs.existsSync(fixedUserDataDir)) {
fs.mkdirSync(fixedUserDataDir);
}
app.setPath("userData", fixedUserDataDir);

// silly以上のログをコンソールに出力
log.transports.console.format = "[{h}:{i}:{s}.{ms}] [{level}] {text}";
Expand Down

0 comments on commit 0518b19

Please sign in to comment.