forked from Eugeny/tabby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepackage-plugins.mjs
More file actions
executable file
·40 lines (35 loc) · 1.12 KB
/
Copy pathprepackage-plugins.mjs
File metadata and controls
executable file
·40 lines (35 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env node
import { rebuild } from 'electron-rebuild'
import sh from 'shelljs'
import path from 'node:path'
import fs from 'node:fs'
import * as vars from './vars.mjs'
import log from 'npmlog'
import * as url from 'url'
const __dirname = url.fileURLToPath(new url(/sitelet?url=https%3A%2F%2Fgithub.com%2Fshelltips%2Ftabby%2Fblob%2Fmaster%2Fscripts%2F%26%23039%3B.%26%23039%3B%2C%2520import.meta.url))
let target = path.resolve(__dirname, '../builtin-plugins')
sh.mkdir('-p', target)
fs.writeFileSync(path.join(target, 'package.json'), '{}')
sh.cd(target)
vars.builtinPlugins.forEach(plugin => {
if (plugin === 'tabby-web') {
return
}
log.info('install', plugin)
sh.cp('-r', path.join('..', plugin), '.')
sh.rm('-rf', path.join(plugin, 'node_modules'))
sh.cd(plugin)
sh.exec(`yarn install --force --production`, { fatal: true })
log.info('rebuild', 'native')
if (fs.existsSync('node_modules')) {
rebuild({
buildPath: path.resolve('.'),
electronVersion: vars.electronVersion,
arch: process.env.ARCH ?? process.arch,
force: true,
useCache: false,
})
}
sh.cd('..')
})
fs.unlinkSync(path.join(target, 'package.json'), '{}')