Use a different name depending on channel

This makes Atom beta install in %LOCALAPPDATA%\atom-beta and stable in 
%LOCALAPPDATA%\atom so that installs are side by side
This commit is contained in:
Linus Eriksson
2019-06-25 17:58:50 +02:00
parent 0ac07e7f32
commit 2d6cc4f172
2 changed files with 9 additions and 0 deletions

View File

@@ -27,11 +27,13 @@ const computedAppVersion = computeAppVersion(
const channel = getChannel(computedAppVersion);
const appName = getAppName(channel);
const executableName = getExecutableName(channel, appName);
const channelName = getChannelName(channel);
module.exports = {
appMetadata,
apmMetadata,
channel,
channelName,
appName,
executableName,
computedAppVersion,
@@ -50,6 +52,12 @@ module.exports = {
snapshotAuxiliaryData: {}
};
function getChannelName(channel) {
return channel === 'stable'
? 'atom'
: `atom-${channel}`;
}
function getChannel(version) {
const match = version.match(/\d+\.\d+\.\d+(-([a-z]+)(\d+|-\w{4,})?)?$/);
if (!match) {

View File

@@ -12,6 +12,7 @@ module.exports = packagedAppPath => {
const updateUrlPrefix =
process.env.ATOM_UPDATE_URL_PREFIX || 'https://atom.io';
const options = {
name: CONFIG.channelName,
title: CONFIG.appName,
exe: CONFIG.executableName,
appDirectory: packagedAppPath,