Skip to content

Commit 3e8809d

Browse files
committed
Include repacked revision
1 parent 7fe0af7 commit 3e8809d

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

electron-builder.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
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+
];
217

318
module.exports = {
4-
asar: editionEnv === 'vanilla',
5-
productName: editionEnv === 'vanilla' ? 'Notion' : 'Notion Enhanced',
19+
asar: editionEnvVar === 'vanilla',
20+
productName: editionEnvVar === 'vanilla' ? 'Notion' : 'Notion Enhanced',
621
extraMetadata: {
722
description:
8-
editionEnv === 'vanilla'
23+
editionEnvVar === 'vanilla'
924
? 'The all-in-one workspace for your notes and tasks'
1025
: 'The all-in-one workspace for your notes and tasks, but enhanced',
1126
},
@@ -44,5 +59,7 @@ module.exports = {
4459
},
4560
target: ['AppImage', 'deb', 'rpm', 'pacman', 'zip'],
4661
},
62+
pacman: { fpm: versionFpmOptions },
63+
rpm: { fpm: versionFpmOptions },
4764
publish: ['github'],
4865
};

scripts/_utils.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set -a
12

23
WORKSPACE_DIR=`realpath $(dirname $0)/..`
34

@@ -16,10 +17,13 @@ NOTION_ENHANCED_SRC_NAME="enhanced-src"
1617
NOTION_EMBEDDED_NAME="embedded_enhancer"
1718

1819
NOTION_REPACKAGED_REVISION="${NOTION_REPACKAGED_REVISION:-1}"
20+
NOTION_REPACKAGED_VERSION_REV="${NOTION_VERSION}-${NOTION_REPACKAGED_REVISION}"
1921
NOTION_REPACKAGED_HOMEPAGE="https://github.com/jamezrin/notion-repackaged"
2022
NOTION_REPACKAGED_REPO=${NOTION_REPACKAGED_REPO:-${NOTION_REPACKAGED_HOMEPAGE}}
2123
NOTION_REPACKAGED_AUTHOR="Notion Repackaged"
2224

25+
set +a
26+
2327
function log() {
2428
caller=`basename "$0"`
2529
echo "[${caller%.*}]: $@"

scripts/extract-src.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ PATCHED_PACKAGE_JSON=$(jq \
4444
--arg homepage "${NOTION_REPACKAGED_HOMEPAGE}" \
4545
--arg repo "${NOTION_REPACKAGED_REPO}" \
4646
--arg author "${NOTION_REPACKAGED_AUTHOR}" \
47+
--arg version "${NOTION_REPACKAGED_VERSION_REV}" \
4748
'.dependencies.cld="2.7.0" |
4849
.name="notion-app" |
4950
.homepage=$homepage |
5051
.repository=$repo |
51-
.author=$author' package.json
52+
.author=$author |
53+
.version=$version' package.json
5254
)
5355
echo "${PATCHED_PACKAGE_JSON}" > package.json
5456

0 commit comments

Comments
 (0)