tldraw/apps/vscode/extension/scripts/package.js
Steve Ruiz 7c2777966f
[improvement] Multiplayer + cursors (#457)
* bump versions, improve cursors

* Spline cursors
2021-12-22 00:14:38 +00:00

45 lines
986 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* eslint-disable */
//const version = require('../../../lerna.json').version
const fs = require('fs')
const pkg = require('../package.json')
const { exec } = require('child_process')
const { log: jslog } = console
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) {
jslog(`× ${pkg.name}: Build failed due to an error.`)
jslog(e)
}
}
main()