Skip to content

Commit

Permalink
Use blue terminal color for run events
Browse files Browse the repository at this point in the history
  • Loading branch information
sinclairzx81 committed Sep 9, 2021
1 parent bdcfd1d commit 1afc788
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sinclair/hammer",
"version": "0.15.5",
"version": "0.15.6",
"description": "Build Tool for Browser and Node Applications",
"author": "sinclairzx81",
"keywords": [
Expand Down
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ class Hammer implements Dispose {
const package_json = JSON.parse(contents)
return package_json.version
} catch (error) {
console.log(error.message)
if(error instanceof Error) {
console.log(error.message)
} else {
console.log(error)
}
return 'Unknown'
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/run/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ import * as path from 'path'
// ----------------------------------------------------------------------

function start(command: string): () => Promise<void> {
const [gray, esc] = ['\x1b[30m', '\x1b[0m']
console.log(`${gray}[run]${esc}`)
const [blue, esc] = ['\x1b[36m', '\x1b[0m']
console.log(`${blue}[run]${esc}`)
const s = new Shell(command, 'inherit')
const p = s.wait().then(() => console.log(`${gray}[end]${esc}`))
const p = s.wait().then(() => console.log(`${blue}[end]${esc}`))
return async () => {
s.dispose()
await p
Expand Down

0 comments on commit 1afc788

Please sign in to comment.