mirror of
https://github.com/atom/atom.git
synced 2026-01-13 08:57:59 -05:00
This module is required both from the main process and the renderer process, since `win-shell.js` is also required from both processes (which is nuts). In order to make it work when used from the main process, `get-app-name` just falls back to use the `atom-environment` `getAppName()` method.
20 lines
493 B
JavaScript
20 lines
493 B
JavaScript
const { app } = require('electron');
|
|
const getReleaseChannel = require('./get-release-channel');
|
|
|
|
module.exports = function getAppName() {
|
|
if (process.type === 'renderer') {
|
|
return atom.getAppName();
|
|
}
|
|
|
|
const releaseChannel = getReleaseChannel(app.getVersion());
|
|
const appNameParts = [app.getName()];
|
|
|
|
if (releaseChannel !== 'stable') {
|
|
appNameParts.push(
|
|
releaseChannel.charAt(0).toUpperCase() + releaseChannel.slice(1)
|
|
);
|
|
}
|
|
|
|
return appNameParts.join(' ');
|
|
};
|