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 273c4c2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,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 +158,7 @@ jobs:
needs: [prepare-source]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
fail-fast: false
matrix:
target: [windows, linux, macos]
include:
Expand Down
20 changes: 16 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,23 @@ 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],
})

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 273c4c2

Please sign in to comment.