mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
fix: bug
This commit is contained in:
parent
2e7e6588a8
commit
78ba547138
10 changed files with 271 additions and 103 deletions
|
|
@ -74,7 +74,7 @@ class DB {
|
|||
this.sqlite = new SQLite3(this.dbFilePath, {
|
||||
nativeBinding: path.join(
|
||||
__dirname,
|
||||
`./better_sqlite3_${process.arch}.node`
|
||||
`./binary/better_sqlite3_${process.arch}.node`
|
||||
),
|
||||
})
|
||||
this.sqlite.pragma('auto_vacuum = FULL')
|
||||
|
|
|
|||
|
|
@ -39,12 +39,12 @@
|
|||
"axios": "^0.27.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"dotenv": "^16.0.0",
|
||||
"electron": "^18.2.2",
|
||||
"electron": "^18.2.1",
|
||||
"electron-builder": "^23.0.3",
|
||||
"electron-devtools-installer": "^3.2.0",
|
||||
"electron-rebuild": "^3.2.7",
|
||||
"electron-releases": "^3.1009.0",
|
||||
"esbuild": "^0.14.38",
|
||||
"esbuild": "^0.14.39",
|
||||
"eslint": "*",
|
||||
"express-fileupload": "^1.3.1",
|
||||
"minimist": "^1.2.6",
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ const isLinux = process.platform === 'linux'
|
|||
|
||||
const projectDir = path.resolve(process.cwd(), '../../')
|
||||
|
||||
if (!fs.existsSync(`${projectDir}/src/main/dist`)) {
|
||||
fs.mkdirSync(`${projectDir}/src/main/dist`, {
|
||||
if (!fs.existsSync(`${projectDir}/packages/electron/dist/binary`)) {
|
||||
fs.mkdirSync(`${projectDir}/packages/electron/dist/binary`, {
|
||||
recursive: true,
|
||||
})
|
||||
}
|
||||
|
|
@ -70,7 +70,7 @@ const download = async arch => {
|
|||
try {
|
||||
fs.copyFileSync(
|
||||
`${dir}/build/Release/better_sqlite3.node`,
|
||||
`${projectDir}/src/main/dist/better_sqlite3_${arch}.node`
|
||||
`${projectDir}/packages/electron/dist/binary/better_sqlite3_${arch}.node`
|
||||
)
|
||||
} catch (e) {
|
||||
console.log(pc.red('Copy failed! Skip copy.', e))
|
||||
|
|
@ -93,8 +93,6 @@ const build = async arch => {
|
|||
|
||||
console.log(pc.cyan(`Building for ${arch}...`))
|
||||
await rebuild({
|
||||
// projectRootPath: projectDir,
|
||||
// buildPath: process.cwd(),
|
||||
projectRootPath: projectDir,
|
||||
buildPath: process.cwd(),
|
||||
electronVersion,
|
||||
|
|
@ -106,7 +104,7 @@ const build = async arch => {
|
|||
console.info('Build succeeded')
|
||||
fs.copyFileSync(
|
||||
`${projectDir}/node_modules/better-sqlite3/build/Release/better_sqlite3.node`,
|
||||
`${projectDir}/src/main/dist/better_sqlite3_${arch}.node`
|
||||
`${projectDir}/packages/electron/dist/binary/better_sqlite3_${arch}.node`
|
||||
)
|
||||
})
|
||||
.catch(e => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue