-
-
Notifications
You must be signed in to change notification settings - Fork 818
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Desktop] Use electron-is-dev instead of NODE_ENV
Fix problem on Windows without bash shell
- Loading branch information
1 parent
f2a8274
commit 2785c78
Showing
3 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Source: https://github.com/sindresorhus/electron-is-dev | ||
|
||
import electron from 'electron' | ||
|
||
const app = electron.app || electron.remote.app | ||
|
||
const isEnvSet = 'ELECTRON_IS_DEV' in process.env | ||
const getFromEnv = | ||
!!process.env.ELECTRON_IS_DEV && | ||
parseInt(process.env.ELECTRON_IS_DEV, 10) === 1 | ||
|
||
export const __DEV__ = isEnvSet ? getFromEnv : !app.isPackaged |