Skip to content

Commit

Permalink
fix: path
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzhang1030 committed Jan 5, 2024
1 parent 1eee247 commit 877fe9b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
"zip": "tsx ./scripts/extension-zip.ts",
"gen:vue-apis": "tsx ./scripts/vue-api-manifest.ts"
},
"dependencies": {
"pathe": "^1.1.1"
},
"devDependencies": {
"@antfu/eslint-config": "2.4.2",
"@antfu/ni": "^0.21.12",
Expand Down
2 changes: 1 addition & 1 deletion packages/electron/scripts/build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolve as _resolve } from 'node:path'
import { resolve as _resolve } from 'pathe'
import type { Options } from 'tsup'
import { build } from 'tsup'
import { build as unbuild } from 'unbuild'
Expand Down
1 change: 1 addition & 0 deletions packages/electron/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function createWindow() {
})
const appEntryPath = path.join(__dirname, '../app.html')
const url = new URL(`file://${appEntryPath}`).toString()
mainWindow.setMenu(null)
mainWindow.loadURL(new URL(url).toString())

mainWindow.on('closed', () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/electron/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { execaSync } from 'execa'
import electron from 'electron'
import { resolve } from 'pathe'

const appPath = new URL('../dist/app.cjs', import.meta.url).pathname
const appPath = resolve(new URL('../dist/app.cjs', import.meta.url).pathname)
const argv = process.argv.slice(2)

const result = execaSync(electron as unknown as string, [appPath].concat(argv), {
Expand Down
14 changes: 9 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 877fe9b

Please sign in to comment.