Navigation | Overlay |
---|---|
t Navigate files | h Toggle hits |
y Change url to tip of branch | m Toggle misses |
b / v Jump to prev/next hit line | p Toggle partial |
z / x Jump to prev/next missed or partial line | 1..9 Toggle flags |
shift + o Open current page in GitHub | a Toggle all on |
/ or ? Show keyboard shortcuts dialog | c Toggle context lines or commits |
1 | 4 |
import * as path from 'path'; |
2 | 4 |
import notifier from 'node-notifier'; |
3 |
|
|
4 | 4 |
const COLORS = { |
5 |
red: '\x1b[31m', |
|
6 |
green: '\x1b[32m', |
|
7 |
yellow: '\x1b[33m', |
|
8 |
blue: '\x1b[34m', |
|
9 |
};
|
|
10 | 4 |
const RESET = '\x1b[0m'; |
11 |
|
|
12 | 4 |
export const output = (content: string | string[], color: 'red' | 'green' | 'blue' | 'yellow') => { |
13 |
const message = Array.isArray(content) ? content : [content]; |
|
14 | 4 |
console.log(`${COLORS[color]}%s${RESET}`, ...message); |
15 |
};
|
|
16 |
|
|
17 |
function log(type: 'error' | 'warn', message: string) { |
|
18 |
console[type](message); |
|
19 |
}
|
|
20 |
|
|
21 |
function notice(message: string) { |
|
22 |
notifier.notify({ |
|
23 |
title: 'Remax build error', |
|
24 |
message, |
|
25 |
icon: path.join(__dirname, '../../../error.png'), |
|
26 |
});
|
|
27 |
}
|
|
28 |
|
|
29 | 4 |
export default { |
30 |
message: output, |
|
31 |
error: (message: string) => log('error', message), |
|
32 |
warn: (message: string) => log('warn', message), |
|
33 |
notice, |
|
34 |
};
|
Read our documentation on viewing source code .