Skip to content

Commit

Permalink
fix(scripts): time output in log
Browse files Browse the repository at this point in the history
Now time output is sane. Previously it would show 10:10:1 instead
of 10:10:10.

See #444
  • Loading branch information
swashata committed Apr 18, 2019
1 parent cc089e8 commit ee82d38
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/scripts/src/bin/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ ${chalk.bold(gradient.instagram(` \\_/\\_/`))} ${chalk.magenta(
)}${chalk.bold.magenta(`${pkg.version}`)}`;

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

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

0 comments on commit ee82d38

Please sign in to comment.