fix: repot time in case of a failure

This commit is contained in:
Amin Yahyaabadi 2022-04-18 03:27:21 -07:00
parent 4ff35803b1
commit 8e9737776a
3 changed files with 5 additions and 3 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -168,12 +168,12 @@ export async function main(args: string[]): Promise<number> {
// installing the specified compiler // installing the specified compiler
const maybeCompiler = opts.compiler const maybeCompiler = opts.compiler
time1 = new Date(Date.now())
try { try {
if (maybeCompiler !== undefined) { if (maybeCompiler !== undefined) {
const { compiler, version } = getCompilerInfo(maybeCompiler) const { compiler, version } = getCompilerInfo(maybeCompiler)
// install the compiler. We allow some aliases for the compiler name // install the compiler. We allow some aliases for the compiler name
time1 = new Date(Date.now())
startGroup(`Installing ${compiler} ${version ?? ""}`) startGroup(`Installing ${compiler} ${version ?? ""}`)
switch (compiler) { switch (compiler) {
case "llvm": case "llvm":
@ -222,6 +222,8 @@ export async function main(args: string[]): Promise<number> {
error(e as string | Error) error(e as string | Error)
errorMessages.push(`Failed to install the ${maybeCompiler}`) errorMessages.push(`Failed to install the ${maybeCompiler}`)
endGroup() endGroup()
time2 = new Date(Date.now())
info(`took ${timeFormatter.format(time1, time2) as string}`)
} }
if (successMessages.length === 0 && errorMessages.length === 0) { if (successMessages.length === 0 && errorMessages.length === 0) {