Skip to content

Commit ee82d38

Browse files
committed
fix(scripts): time output in log
Now time output is sane. Previously it would show 10:10:1 instead of 10:10:10. See #444
1 parent cc089e8 commit ee82d38

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/scripts/src/bin/utils.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ ${chalk.bold(gradient.instagram(` \\_/\\_/`))} ${chalk.magenta(
2828
)}${chalk.bold.magenta(`${pkg.version}`)}`;
2929

3030
export function addTimeStampToLog(log: string): string {
31-
const date = new Date();
32-
return `${chalk.dim(
33-
`「wpack.io ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}」`
34-
)} ${log}`;
31+
const time = new Date().toTimeString().split(' ')[0];
32+
return `${chalk.dim(`「wpack.io ${time}」`)} ${log}`;
3533
}
3634

3735
export const watchSymbol = `${logSymbols.info}`;

0 commit comments

Comments
 (0)