更新依赖&版本号(2.12.3-beta.11)
This commit is contained in:
@@ -9,7 +9,7 @@ const getGzipFiles = async() => {
|
||||
// for (const name of names) {
|
||||
// if (name.endsWith('.node')) await fs.promises.unlink(path.join(libDir, name))
|
||||
// }
|
||||
return names.filter(name => name.endsWith('.gz'))
|
||||
return names.filter((name) => name.endsWith('.gz'))
|
||||
}
|
||||
|
||||
const unzip = async(filePath) => {
|
||||
@@ -18,22 +18,20 @@ const unzip = async(filePath) => {
|
||||
await fs.promises.mkdir(targetDir)
|
||||
await tar.x({
|
||||
file: filePath,
|
||||
strip: 1,
|
||||
strip: 0,
|
||||
C: targetDir,
|
||||
})
|
||||
return targetDir
|
||||
}
|
||||
|
||||
const files = [
|
||||
'better_sqlite3',
|
||||
]
|
||||
const files = ['better_sqlite3']
|
||||
const moveFile = async(filePath) => {
|
||||
const name = 'electron-' + path.basename(filePath).split('-electron-')[1]
|
||||
const name = `${path.basename(filePath).split('_v')[0].replace('_', '-')}`
|
||||
for (const fileName of files) {
|
||||
if (fileName == 'better_sqlite3' && !name.includes('linux')) continue
|
||||
const targetPath = path.join(libDir, `${fileName}_${name}.node`)
|
||||
if (fs.existsSync(targetPath)) await fs.promises.unlink(targetPath)
|
||||
await fs.promises.rename(path.join(filePath, 'Release', fileName + '.node'), targetPath)
|
||||
await fs.promises.rename(path.join(filePath, `${fileName}.node`), targetPath)
|
||||
}
|
||||
await fs.promises.rm(filePath, { recursive: true })
|
||||
}
|
||||
@@ -49,4 +47,3 @@ const run = async() => {
|
||||
}
|
||||
|
||||
run()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user