mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-09 01:17:06 +08:00
build the sqlite plugin before run dev/build
This commit is contained in:
@@ -7,13 +7,13 @@
|
|||||||
"productName": "GeekGeekRun",
|
"productName": "GeekGeekRun",
|
||||||
"homepage": "https://github.com/geekgeekrun",
|
"homepage": "https://github.com/geekgeekrun",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "electron-vite preview",
|
"start": "node scripts/build.mjs && electron-vite preview",
|
||||||
"dev": "electron-vite dev",
|
"dev": "node scripts/build.mjs && electron-vite dev",
|
||||||
"dev:geek-auto-start-chat-with-boss-main-only": "cross-env MAIN_BOSSGEEKGO_UI_RUN_MODE=geekAutoStartWithBossMain electron-vite dev",
|
"dev:geek-auto-start-chat-with-boss-main-only": "cross-env MAIN_BOSSGEEKGO_UI_RUN_MODE=geekAutoStartWithBossMain pnpm run dev",
|
||||||
"dev:geek-auto-start-chat-with-boss-daemon-only": "cross-env MAIN_BOSSGEEKGO_UI_RUN_MODE=geekAutoStartWithBossDaemon electron-vite dev",
|
"dev:geek-auto-start-chat-with-boss-daemon-only": "cross-env MAIN_BOSSGEEKGO_UI_RUN_MODE=geekAutoStartWithBossDaemon pnpm run dev",
|
||||||
"dev:check-and-download-dependencies-for-init-only": "cross-env MAIN_BOSSGEEKGO_UI_RUN_MODE=checkAndDownloadDependenciesForInit electron-vite dev",
|
"dev:check-and-download-dependencies-for-init-only": "cross-env MAIN_BOSSGEEKGO_UI_RUN_MODE=checkAndDownloadDependenciesForInit pnpm run dev",
|
||||||
"dev:launch-bosszhipin-login-page-with-preload-extension-only": "cross-env MAIN_BOSSGEEKGO_UI_RUN_MODE=launchBossZhipinLoginPageWithPreloadExtension electron-vite dev",
|
"dev:launch-bosszhipin-login-page-with-preload-extension-only": "cross-env MAIN_BOSSGEEKGO_UI_RUN_MODE=launchBossZhipinLoginPageWithPreloadExtension pnpm run dev",
|
||||||
"build": "electron-vite build",
|
"build": "node scripts/build.mjs && electron-vite build",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts,.vue --fix",
|
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts,.vue --fix",
|
||||||
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
|
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import childProcess from "node:child_process"
|
||||||
|
import fs from "node:fs"
|
||||||
|
import path from "node:path"
|
||||||
|
import os from "node:os"
|
||||||
|
import url from 'node:url'
|
||||||
|
|
||||||
|
const rawCwd = process.cwd()
|
||||||
|
const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
|
||||||
|
|
||||||
|
const sqlitePluginDirPath = path.join(__dirname, '../../sqlite-plugin')
|
||||||
|
process.chdir(sqlitePluginDirPath)
|
||||||
|
try {
|
||||||
|
const sqlitePluginBuildProcess = childProcess.spawnSync('pnpm run build', {
|
||||||
|
stdio: ['inherit', 'inherit', 'inherit'],
|
||||||
|
shell: true
|
||||||
|
})
|
||||||
|
process.chdir(rawCwd)
|
||||||
|
if (sqlitePluginBuildProcess.error) {
|
||||||
|
throw sqlitePluginBuildProcess.error
|
||||||
|
}
|
||||||
|
} catch(error) {
|
||||||
|
process.chdir(rawCwd)
|
||||||
|
console.error('error encouter when build sqlite plugin:')
|
||||||
|
console.error(error)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user