|
1 | | -const editionEnv = process.env.NOTION_REPACKAGED_EDITION || 'vanilla'; |
| 1 | +function ensureEnvVar(envVarName) { |
| 2 | + if (!(envVarName in process.env)) { |
| 3 | + throw new Error(`Missing environment variable ${envVarName}`); |
| 4 | + } |
| 5 | + |
| 6 | + return process.env[envVarName]; |
| 7 | +} |
| 8 | + |
| 9 | +const editionEnvVar = ensureEnvVar('NOTION_REPACKAGED_EDITION'), |
| 10 | + versionEnvVar = ensureEnvVar('NOTION_VERSION'), |
| 11 | + revisionEnvVar = ensureEnvVar('NOTION_REPACKAGED_REVISION'); |
| 12 | + |
| 13 | +const versionFpmOptions = [ |
| 14 | + `--version=${versionEnvVar}`, |
| 15 | + `--iteration=${revisionEnvVar}` |
| 16 | +]; |
2 | 17 |
|
3 | 18 | module.exports = { |
4 | | - asar: editionEnv === 'vanilla', |
5 | | - productName: editionEnv === 'vanilla' ? 'Notion' : 'Notion Enhanced', |
| 19 | + asar: editionEnvVar === 'vanilla', |
| 20 | + productName: editionEnvVar === 'vanilla' ? 'Notion' : 'Notion Enhanced', |
6 | 21 | extraMetadata: { |
7 | 22 | description: |
8 | | - editionEnv === 'vanilla' |
| 23 | + editionEnvVar === 'vanilla' |
9 | 24 | ? 'The all-in-one workspace for your notes and tasks' |
10 | 25 | : 'The all-in-one workspace for your notes and tasks, but enhanced', |
11 | 26 | }, |
@@ -44,5 +59,7 @@ module.exports = { |
44 | 59 | }, |
45 | 60 | target: ['AppImage', 'deb', 'rpm', 'pacman', 'zip'], |
46 | 61 | }, |
| 62 | + pacman: { fpm: versionFpmOptions }, |
| 63 | + rpm: { fpm: versionFpmOptions }, |
47 | 64 | publish: ['github'], |
48 | 65 | }; |
0 commit comments