Skip to content

Commit

Permalink
ビルド後はappDirPathにある.envを読みに行く
Browse files Browse the repository at this point in the history
  • Loading branch information
PickledChair committed May 3, 2022
1 parent 8accdfe commit ca23402
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ process.on("unhandledRejection", (reason) => {

// .envから設定をprocess.envに読み込み
const appDirPath = path.dirname(app.getPath("exe"));
dotenv.config({ override: true });
if (isDevelopment) {
dotenv.config({ override: true });
} else {
const envPath = path.join(appDirPath, ".env");
dotenv.config({ path: envPath });
}

protocol.registerSchemesAsPrivileged([
{ scheme: "app", privileges: { secure: true, standard: true, stream: true } },
Expand Down

0 comments on commit ca23402

Please sign in to comment.