fix: fallback to 0 seconds if format string is nothing [skip ci]

This commit is contained in:
Amin Yahyaabadi 2022-04-18 06:24:04 -07:00
parent c5296bc8b0
commit 07ebf37b77
3 changed files with 5 additions and 5 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

@ -173,7 +173,7 @@ export async function main(args: string[]): Promise<number> {
} }
endGroup() endGroup()
time2 = Date.now() time2 = Date.now()
info(`took ${timeFormatter.format(time1, time2)}`) info(`took ${timeFormatter.format(time1, time2) || "0 seconds"}`)
} }
} }
@ -227,14 +227,14 @@ export async function main(args: string[]): Promise<number> {
} }
endGroup() endGroup()
time2 = Date.now() time2 = Date.now()
info(`took ${timeFormatter.format(time1, time2)}`) info(`took ${timeFormatter.format(time1, time2) || "0 seconds"}`)
} }
} catch (e) { } catch (e) {
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 = Date.now() time2 = Date.now()
info(`took ${timeFormatter.format(time1, time2)}`) info(`took ${timeFormatter.format(time1, time2) || "0 seconds"}`)
} }
if (successMessages.length === 0 && errorMessages.length === 0) { if (successMessages.length === 0 && errorMessages.length === 0) {