Skip to content

Commit

Permalink
fix: notion path for enhancing
Browse files Browse the repository at this point in the history
  • Loading branch information
jamezrin committed Jun 5, 2024
1 parent 3fd6ac0 commit 9171aa0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ on:
env:
NOTION_DESKTOP_BASE_URL: https://desktop-release.notion-static.com

concurrency:
cancel-in-progress: true
group: prepare-release

jobs:
prepare-source:
name: Prepare source
Expand Down Expand Up @@ -127,6 +131,15 @@ jobs:
run: |
npm install --package-lock-only --no-package-lock --save \
git://github.com/notion-enhancer/notion-enhancer.git#${NOTION_ENHANCER_COMMIT}
- name: Install additional packages
working-directory: work/clean-source
shell: bash
env:
GLOB_VERSION: 10.4.1
run: |
npm install --package-lock-only --no-package-lock --save-dev \
glob@${GLOB_VERSION}
- name: Update lockfile
working-directory: work/clean-source
Expand All @@ -149,7 +162,7 @@ jobs:
needs: [prepare-source]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
fail-fast: false
matrix:
target: [windows, linux, macos]
include:
Expand Down
21 changes: 17 additions & 4 deletions forge.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require('node:path')
const fs = require('node:fs/promises')
const { glob } = require('glob')

const sharedLinuxMakersOptions = {
name: 'notion-enhanced',
Expand Down Expand Up @@ -98,12 +99,24 @@ module.exports = {
'notion-enhancer/scripts/enhance-desktop-app.mjs'
)

const path = options.outputPaths[0]
console.log('Setting notion path:', path)
enhancer.setNotionPath(path)
const appAsarPaths = await glob('**/app.asar', {
cwd: options.outputPaths[0],
absolute: true,
})

if (appAsarPaths.length !== 1) {
throw new Error('Expected exactly one app.asar file')
}

const appResourcesDir = path.dirname(appAsarPaths[0])
console.log('Setting notion resources path:', appResourcesDir)
console.log('Directory contents:', await fs.readdir(appResourcesDir))
enhancer.setNotionPath(appResourcesDir)

const result = await enhancer.enhanceApp(true)
console.log('Enhancer result:', result)
if (!result) {
throw new Error('Failed to enhance app')
}
},
},
}

0 comments on commit 9171aa0

Please sign in to comment.