mirror of
https://github.com/cockpit-project/cockpit.git
synced 2026-11-03 21:49:50 -09:00
build.js: Show total build duration
Copied from cockpit-files and other plugins.
This commit is contained in:
parent
8443126a7b
commit
9cd68ac97a
1 changed files with 11 additions and 3 deletions
14
build.js
14
build.js
|
|
@ -164,8 +164,6 @@ async function build() {
|
|||
})
|
||||
];
|
||||
|
||||
const getTime = () => new Date().toTimeString().split(' ')[0];
|
||||
|
||||
const pkgLastPlugins = [
|
||||
cockpitPoEsbuildPlugin({
|
||||
subdirs: args.onlydir ? [args.onlydir] : all_subdirs,
|
||||
|
|
@ -197,7 +195,17 @@ async function build() {
|
|||
{
|
||||
name: 'notify-end',
|
||||
setup(build) {
|
||||
build.onEnd(() => console.log(`${getTime()}: Build finished`));
|
||||
let startTime;
|
||||
|
||||
build.onStart(() => {
|
||||
startTime = new Date();
|
||||
});
|
||||
|
||||
build.onEnd(() => {
|
||||
const endTime = new Date();
|
||||
const timeStamp = endTime.toTimeString().split(' ')[0];
|
||||
console.log(`${timeStamp}: Build finished in ${endTime - startTime} ms`);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue