Skip to content
代码片段 群组 项目
提交 0c7352b8 编辑于 作者: Timotej Ecimovic's avatar Timotej Ecimovic
浏览文件

Add the end-of-run cleanup action to set package.json back to 0.0.0

上级 20a5bb72
No related branches found
No related tags found
无相关合并请求
......@@ -22,10 +22,7 @@ let startTime = process.hrtime.bigint()
//workaround: executeCmd()/spawn() fails silently without complaining about missing path to electron
process.env.PATH = process.env.PATH + ':/usr/local/bin/'
scriptUtil
.rebuildSpaIfNeeded()
.then(() => scriptUtil.doneStamp(startTime))
.catch((err) => {
console.log(err)
process.exit(1)
})
scriptUtil.rebuildSpaIfNeeded().catch((err) => {
console.log(err)
process.exit(1)
})
......@@ -257,7 +257,6 @@ async function setPackageJsonVersion(date, mode) {
if (wasChanged) {
fs.writeFileSync(packageJson, output)
}
console.log(`🔍 Version output: ${versionPrinted}`)
resolve(wasChanged)
})
})
......@@ -283,12 +282,14 @@ function duration(nsDifference) {
/**
* Printout of timings at the end of a script.
* This function also cleans up the package.json
*
* @param {*} startTime
*/
function doneStamp(startTime) {
async function doneStamp(startTime) {
let nsDuration = process.hrtime.bigint() - startTime
console.log(`😎 All done: ${duration(nsDuration)}.`)
return setPackageJsonVersion(null, 'fake')
}
/**
......
......@@ -70,8 +70,8 @@ scriptUtil
.stampVersion()
.then(() => scriptUtil.rebuildBackendIfNeeded())
.then(() => scriptUtil.executeCmd(ctx, 'node', cli))
.then(() => scriptUtil.doneStamp(startTime))
.then(() => {
scriptUtil.doneStamp(startTime)
process.exit(0)
})
.catch((code) => {
......
......@@ -92,8 +92,8 @@ scriptUtil
.stampVersion()
.then(() => scriptUtil.rebuildBackendIfNeeded())
.then(() => scriptUtil.executeCmd(ctx, 'node', cli))
.then(() => scriptUtil.doneStamp(startTime))
.then(() => {
scriptUtil.doneStamp(startTime)
process.exit(0)
})
.catch((code) => {
......
......@@ -76,8 +76,8 @@ scriptUtil
cmdArgs.push(...args)
return scriptUtil.executeCmd(null, 'npx', cmdArgs)
})
.then(() => scriptUtil.doneStamp(startTime))
.then(() => {
scriptUtil.doneStamp(startTime)
process.exit(0)
})
.catch((err) => {
......
......@@ -18,14 +18,9 @@
const scriptUtil = require('./script-util.js')
let startTime = process.hrtime.bigint()
//workaround: executeCmd()/spawn() fails silently without complaining about missing path to electron
process.env.PATH = process.env.PATH + ':/usr/local/bin/'
scriptUtil
.stampVersion()
.then(() => scriptUtil.doneStamp(startTime))
.catch((err) => {
console.log(err)
})
scriptUtil.stampVersion().catch((err) => {
console.log(err)
})
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册