get-app-name.js
1 const { app } = require('electron'); 2 const getReleaseChannel = require('./get-release-channel'); 3 4 module.exports = function getAppName() { 5 if (process.type === 'renderer') { 6 return atom.getAppName(); 7 } 8 9 const releaseChannel = getReleaseChannel(app.getVersion()); 10 const appNameParts = [app.getName()]; 11 12 if (releaseChannel !== 'stable') { 13 appNameParts.push( 14 releaseChannel.charAt(0).toUpperCase() + releaseChannel.slice(1) 15 ); 16 } 17 18 return appNameParts.join(' '); 19 };