e6a3e5c3ea
* move core into repo, apps into apps folder, update tests * Update scripts for build:core * improve scripts * remove noise from www * Update .gitignore * Fix focus bug * add ci test script * Update main.yml
43 lines
966 B
JavaScript
43 lines
966 B
JavaScript
/* eslint-disable */
|
||
//const version = require('../../../lerna.json').version
|
||
const fs = require('fs')
|
||
const pkg = require('../package.json')
|
||
const { exec } = require('child_process')
|
||
|
||
async function main() {
|
||
if (fs.existsSync('./editor')) {
|
||
fs.rmSync('./editor', { recursive: true }, (e) => {
|
||
if (e) {
|
||
throw e
|
||
}
|
||
})
|
||
}
|
||
if (fs.existsSync('./temp')) {
|
||
fs.rmSync('./temp', { recursive: true }, (e) => {
|
||
if (e) {
|
||
throw e
|
||
}
|
||
})
|
||
}
|
||
|
||
fs.mkdirSync('./temp')
|
||
|
||
try {
|
||
exec(
|
||
`cp -r ../editor/dist editor; vsce package; mv ${pkg.name}-${pkg.version}.vsix ${'./temp'}`,
|
||
(error, stdout, stderr) => {
|
||
if (error) {
|
||
throw new Error(error.message)
|
||
}
|
||
if (stderr && stderr.search('warning') !== 0) {
|
||
throw new Error(stderr)
|
||
}
|
||
}
|
||
)
|
||
} catch (e) {
|
||
console.log(`× ${pkg.name}: Build failed due to an error.`)
|
||
console.log(e)
|
||
}
|
||
}
|
||
|
||
main()
|