aboutsummaryrefslogtreecommitdiffstats
path: root/src/environment.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/environment.js')
-rw-r--r--src/environment.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/environment.js b/src/environment.js
new file mode 100644
index 000000000..e185120c0
--- /dev/null
+++ b/src/environment.js
@@ -0,0 +1,22 @@
1import { LIVE_API, DEV_API, LOCAL_API } from './config';
2
3export const isDevMode = Boolean(process.execPath.match(/[\\/]electron/));
4export const useLiveAPI = process.env.LIVE_API;
5export const useLocalAPI = process.env.LOCAL_API;
6
7export const isMac = process.platform === 'darwin';
8export const isWindows = process.platform === 'win32';
9export const isLinux = process.platform === 'linux';
10
11export const ctrlKey = isMac ? '⌘' : 'Ctrl';
12
13let api;
14if (!isDevMode || (isDevMode && useLiveAPI)) {
15 api = LIVE_API;
16} else if (isDevMode && useLocalAPI) {
17 api = LOCAL_API;
18} else {
19 api = DEV_API;
20}
21
22export const API = api;