Skip to content

Commit

Permalink
feat: log build time
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed Jan 31, 2021
1 parent 6d14c47 commit 1621bcd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7794,11 +7794,13 @@ async function Qc({checkoutRef: e, refData: t, buildCommand: r}) {
throw new Error(`Failed to install dependencies:\n${e.message}`);
}));
Y.info(`Running build command: ${r}`);
const e = Date.now();
await Vc(r, {
cwd: o
}).catch((e => {
throw new Error(`Failed to run build command: ${r}\n${e.message}`);
}));
Y.info(`Build completed in ${(Date.now() - e) / 1e3}s`);
}
}
if (!Zc) {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/build-ref.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ async function buildRef({
});

log.info(`Running build command: ${buildCommand}`);
const buildStart = Date.now();
await exec(buildCommand, { cwd }).catch((error) => {
throw new Error(`Failed to run build command: ${buildCommand}\n${error.message}`);
});
log.info(`Build completed in ${(Date.now() - buildStart) / 1000}s`);
}
}

Expand Down

0 comments on commit 1621bcd

Please sign in to comment.