forked from digidem/mapeo-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
50 lines (40 loc) · 1.42 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var appConfig = require('application-config')('Mapeo')
var path = require('path')
var APP_NAME = 'Mapeo'
var APP_TEAM = 'Digital Democracy'
var APP_VERSION = require('./package.json').version
module.exports = {
APP_COPYRIGHT: 'Copyright © 2016 ' + APP_TEAM,
APP_ICON: path.join(__dirname, 'static', 'Mapeo'),
APP_NAME: APP_NAME,
APP_TEAM: APP_TEAM,
APP_VERSION: APP_VERSION,
APP_WINDOW_TITLE: APP_NAME + ' (BETA)',
AUTO_UPDATE_CHECK_STARTUP_DELAY: 5 * 1000 /* 5 seconds */,
// AUTO_UPDATE_URL: 'https://webtorrent.io/desktop/update' +
// '?version=' + APP_VERSION + '&platform=' + process.platform,
CONFIG_PATH: getConfigPath(),
GITHUB_URL: 'https://github.com/digidem/mapeo-desktop',
GITHUB_URL_RAW: 'https://raw.githubusercontent.com/digidem/mapeo-desktop/master',
IS_PRODUCTION: isProduction(),
ROOT_PATH: __dirname,
STATIC_PATH: path.join(__dirname, 'static'),
WINDOW_MAIN: 'file://' + path.join(__dirname, 'renderer', 'main.html')
}
function getConfigPath () {
return path.dirname(appConfig.filePath)
}
function isProduction () {
if (!process.versions.electron) {
return false
}
if (process.platform === 'darwin') {
return !/\/Electron\.app\/Contents\/MacOS\/Electron$/.test(process.execPath)
}
if (process.platform === 'win32') {
return !/\\electron\.exe$/.test(process.execPath)
}
if (process.platform === 'linux') {
return !/\/electron$/.test(process.execPath)
}
}