Merge branch 'master' into feat/hnswlib+transformer-js

This commit is contained in:
Tienson Qin
2025-07-31 20:08:29 +08:00
19 changed files with 269 additions and 230 deletions

View File

@@ -1,5 +1,6 @@
const fs = require('fs')
const path = require('path')
const os = require('os')
const { ipcRenderer, contextBridge, shell, clipboard, webFrame } = require('electron')
const IS_MAC = process.platform === 'darwin'
@@ -86,8 +87,11 @@ contextBridge.exposeInMainWorld('apis', {
await shell.openExternal(url, options)
},
async openPath (path) {
await shell.openPath(path)
async openPath (relativePath) {
const absolutePath = path.resolve(
relativePath.startsWith('~') ? path.join(os.homedir(), relativePath.slice(1)) : relativePath
);
await shell.openPath(absolutePath)
},
/**