Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// App constants
export const APP_NAME = pkg.productName;
export const APP_VERSION = pkg.version;
// Path constants
export const ROOT_PATH = path.join(__dirname, '..');
export const CONFIG_PATH = path.dirname(appConfig.filePath);
export const DEFAULT_DOWNLOAD_PATH = getDefaultDownloadPath();
// Window constants
export const WINDOW_MAIN = getWindowPath('app.html'); // Ples rename to main.html
export const WINDOW_TORRENTENGINE = getWindowPath('torrentEngine.html');
// Generic constants
export const DELAYED_INIT = 3000; /* 3 seconds */
export const OS_SYSARCH = arch() === 'x64' ? 'x64' : 'ia32';
function getDefaultDownloadPath() {
return getPath('downloads');
}
function getPath(key) {
if (!process.versions.electron) {
// Node.js process
return '';
} else if (process.type === 'renderer') {
// Electron renderer process
return electron.remote.app.getPath(key);
}
// Electron main process
return electron.app.getPath(key);