Skip to content

Commit

Permalink
revert electronBuilder.config.to to JavaScript
Browse files Browse the repository at this point in the history
  • Loading branch information
JKobrynski committed Mar 8, 2024
1 parent 3c29359 commit ca48f2c
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ const {version} = require('../package.json');

const pullRequestNumber = process.env.PULL_REQUEST_NUMBER;

const s3Bucket: Record<string, string> = {
const s3Bucket = {
production: 'expensify-cash',
staging: 'staging-expensify-cash',
adhoc: 'ad-hoc-expensify-cash',
};

const s3Path: Record<string, string> = {
const s3Path = {
production: '/',
staging: '/',
adhoc: process.env.PULL_REQUEST_NUMBER ? `/desktop/${pullRequestNumber}/` : '/',
};

const macIcon: Record<string, string> = {
const macIcon = {
production: './desktop/icon.png',
staging: './desktop/icon-stg.png',
adhoc: './desktop/icon-adhoc.png',
};

const isCorrectElectronEnv: boolean = ['production', 'staging', 'adhoc'].includes(process.env.ELECTRON_ENV ?? '');
const isCorrectElectronEnv = ['production', 'staging', 'adhoc'].includes(process.env.ELECTRON_ENV);

if (!isCorrectElectronEnv) {
throw new Error('Invalid ELECTRON_ENV!');
Expand All @@ -37,7 +37,7 @@ module.exports = {
},
mac: {
category: 'public.app-category.finance',
icon: process.env.ELECTRON_ENV ? macIcon[process.env.ELECTRON_ENV] : undefined,
icon: macIcon[process.env.ELECTRON_ENV],
hardenedRuntime: true,
entitlements: 'desktop/entitlements.mac.plist',
entitlementsInherit: 'desktop/entitlements.mac.plist',
Expand All @@ -54,9 +54,9 @@ module.exports = {
publish: [
{
provider: 's3',
bucket: process.env.ELECTRON_ENV ? s3Bucket[process.env.ELECTRON_ENV] : undefined,
bucket: s3Bucket[process.env.ELECTRON_ENV],
channel: 'latest',
path: process.env.ELECTRON_ENV ? s3Path[process.env.ELECTRON_ENV] : undefined,
path: s3Path[process.env.ELECTRON_ENV],
},
],
files: ['dist', '!dist/www/{.well-known,favicon*}'],
Expand Down

0 comments on commit ca48f2c

Please sign in to comment.