Skip to content

Commit

Permalink
style(output): prettify console output
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuri committed Nov 10, 2017
1 parent eac7aa4 commit 6090cca
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
10 changes: 5 additions & 5 deletions src/api/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ export function attachExec(id: string, cmd: any): Observable<any> {
if (cmd.type === CommandType.store_cache) {
observer.next({
type: 'data',
data: chalk.yellow('==> saving cache ...') + '\r\n' });
data: chalk.bold(chalk.yellow('==> saving cache ...')) + '\r\n' });
} else if (cmd.type === CommandType.restore_cache) {
observer.next({
type: 'data',
data: chalk.yellow('==> restoring cache ...') + '\r\n' });
data: chalk.bold(chalk.yellow('==> restoring cache ...')) + '\r\n' });
} else {
observer.next({ type: 'data', data: chalk.yellow('==> ' + command) + '\r\n' });
observer.next({ type: 'data', data: chalk.bold(chalk.yellow('==> ' + command)) + '\r\n' });
}

const container = docker.getContainer(id);
Expand All @@ -98,7 +98,7 @@ export function attachExec(id: string, cmd: any): Observable<any> {
});

ws._write = (chunk, enc, next) => {
let str = chunk.toString('utf8');
let str = chunk.toString();

if (str.includes('[error]')) {
const splitted = str.split(' ');
Expand All @@ -107,7 +107,7 @@ export function attachExec(id: string, cmd: any): Observable<any> {
} else if (str.includes('[success]')) {
exitCode = 0;
ws.end();
} else if (!str.includes('/usr/bin/abstruse \'' + cmd.command) && !str.startsWith('>')) {
} else if (!str.includes('/usr/bin/abstruse') && !str.startsWith('>')) {
if (str.includes('//') && str.includes('@')) {
str = str.replace(/\/\/(.*)@/, '//');
}
Expand Down
4 changes: 2 additions & 2 deletions src/api/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export function startBuildProcess(
`build: ${proc.build_id} job: ${proc.job_id} =>`,
`last executed command exited with code ${event.data}`
].join(' ');
const tmsg = `[error]: executed command returned exit code ${event.data}`;
const tmsg = chalk.bold(`[error]: executed command returned exit code ${event.data}`);
observer.next({ type: 'exit', data: chalk.red(tmsg) });
observer.error(msg);
docker.killContainer(name)
Expand All @@ -145,7 +145,7 @@ export function startBuildProcess(
})
.catch(err => console.error(err));
}, () => {
const msg = '[success]: build returned exit code 0';
const msg = chalk.bold('[success]: build returned exit code 0');
observer.next({ type: 'exit', data: chalk.green(msg) });
docker.killContainer(name)
.then(() => {
Expand Down
11 changes: 4 additions & 7 deletions src/app/components/app-terminal/app-terminal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ export class AppTerminalComponent implements OnInit {
this.hterm.prefs_.set('font-size', 11);
this.hterm.prefs_.set('audible-bell-sound', '');
this.hterm.prefs_.set('font-smoothing', 'subpixel-antialiased');
this.hterm.prefs_.set('enable-bold', false);
this.hterm.prefs_.set('backspace-sends-backspace', true);
this.hterm.prefs_.set('enable-bold', true);
this.hterm.prefs_.set('cursor-blink', false);
this.hterm.prefs_.set('receive-encoding', 'raw');
this.hterm.prefs_.set('send-encoding', 'raw');
Expand All @@ -57,9 +56,9 @@ export class AppTerminalComponent implements OnInit {
this.hterm.prefs_.set('enable-clipboard-notice', false);
this.hterm.prefs_.set('background-color', '#000000');
this.hterm.prefs_.set('foreground-color', '#f8f8f2');
hterm.lib.colors.stockColorPalette.splice(0, terminalColorPallete.length)
hterm.lib.colors.stockColorPalette = terminalColorPallete.concat(
hterm.lib.colors.stockColorPalette);
hterm.lib.colors.stockColorPalette.splice(0, terminalColorPallete.length);
hterm.lib.colors.stockColorPalette = terminalColorPallete
.concat(hterm.lib.colors.stockColorPalette);
this.hterm.prefs_.set('color-palette-overrides', terminalColorPallete);

this.terminalReady = true;
Expand All @@ -83,8 +82,6 @@ export class AppTerminalComponent implements OnInit {
return;
}

console.log(this.data);

if (!this.terminalReady) {
this.unwritenChanges += this.data;
} else {
Expand Down
3 changes: 0 additions & 3 deletions src/app/styles/terminal.sass
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
position: relative
display: block
color: #ffffff
margin: 0
padding: 0
height: 100%
background: #000000
height: 600px
-webkit-font-smoothing: auto
Expand Down

0 comments on commit 6090cca

Please sign in to comment.