Skip to content
代码片段 群组 项目
提交 f0b6f250 编辑于 作者: Jing Teng's avatar Jing Teng 提交者: Jing T
浏览文件

fix sqlite schema copy logic during builds

上级 f67e7dc2
No related branches found
No related tags found
无相关合并请求
{
"type": "commonjs",
"name": "zap",
"version": "2022.3.2",
"version": "2022.3.3",
"description": "Configuration tool for the Zigbee Cluster Library",
"productName": "zap",
"cordovaId": "",
......
......@@ -16,7 +16,6 @@
*/
const scriptUtil = require('./script-util.js')
const copyfiles = require('copyfiles')
let startTime = process.hrtime()
......@@ -26,18 +25,6 @@ process.env.PATH = process.env.PATH + ':/usr/local/bin/'
scriptUtil
.rebuildBackendIfNeeded()
.then(() => {
// manually copy SQL schema since TypeScript compiler ignores it.
console.log(`Copying ./src-electron/**/*.sql into ./dist/`)
copyfiles(
['./src-electron/**/*.sql', './dist/'],
{ verbose: true },
(err) => {
if (err) {
console.log(err)
throw err
}
}
)
let endTime = process.hrtime(startTime)
console.log(
`😎 All done: ${endTime[0]}s, ${Math.round(endTime[1] / 1000000)}ms.`
......
......@@ -166,7 +166,16 @@ async function rebuildSpaIfNeeded() {
}
async function rebuildBackendIfNeeded() {
return scriptUtil.executeCmd({}, 'npx', ['tsc', '--build', './tsconfig.json'])
return scriptUtil
.executeCmd({}, 'npx', ['tsc', '--build', './tsconfig.json'])
.then(() =>
scriptUtil.executeCmd({}, 'npx', [
'copyfiles',
'-V',
'./src-electron/**/*.sql',
'./dist/',
])
)
}
/**
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册