Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #190 from tyrsius/master
Browse files Browse the repository at this point in the history
change brightBlack to reset get neutral color on dark themes
  • Loading branch information
nchanged committed Feb 16, 2017
2 parents 1dc8c1f + 81bdeef commit 0e730b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions src/Log.ts
Expand Up @@ -41,14 +41,14 @@ export class Log {
let bytes = Buffer.byteLength(contents, "utf8");
let size = prettysize(bytes);
this.totalSize += bytes;
cursor.brightBlack().write(`└──`)
cursor.reset().write(`└──`)
.green().write(` ${collection.cachedName || collection.name}`)
.yellow().write(` (${collection.dependencies.size} files, ${size})`)

cursor.write("\n")
collection.dependencies.forEach(file => {
if (!file.info.isRemoteFile) {
cursor.brightBlack().write(` ${file.info.fuseBoxPath}`).write("\n")
cursor.reset().write(` ${file.info.fuseBoxPath}`).write("\n")
}
});
cursor.reset();
Expand All @@ -61,9 +61,9 @@ export class Log {
let bytes = Buffer.byteLength(contents, "utf8");
let size = prettysize(bytes);
this.totalSize += bytes;
cursor.brightBlack().write(`└──`)
cursor.reset().write(`└──`)
.green().write(` ${collection.cachedName || collection.name}`)
.brightBlack().write(` (${collection.dependencies.size} files)`)
.reset().write(` (${collection.dependencies.size} files)`)
.yellow().write(` ${size}`)
.write("\n").reset();
}
Expand All @@ -74,11 +74,11 @@ export class Log {
}
let took = process.hrtime(this.timeStart)
cursor.write("\n")
.brightBlack().write(` --------------\n`)
.reset().write(` --------------\n`)
.yellow().write(` Size: ${prettysize(this.totalSize)} \n`)
.yellow().write(` Time: ${prettyTime(took, "ms")}`)
.write("\n")
.brightBlack().write(` --------------\n`)
.reset().write(` --------------\n`)
.write("\n").reset();
}
}
}
18 changes: 9 additions & 9 deletions src/PrettyError.ts
Expand Up @@ -2,25 +2,25 @@ import { File } from "./File";
const ansi = require("ansi");
const cursor = ansi(process.stdout);
/**
*
*
*
*
* @export
* @class PrettyTrace
*/
export class PrettyError {
/**
* Prints a pretty error
* Prints a pretty error
* Based on Acorn Exception
*
*
* It order for it work an exception must have err.loc with (line)
* For example:
*
*
* Position { line: 1, column: 5 }
*
*
* @static
* @param {*} position
* @param {string} contents
*
*
* @memberOf PrettyTrace
*/
public static errorWithContents(error: any, file: File) {
Expand All @@ -47,12 +47,12 @@ export class PrettyError {
l.white().bg.red().write(`${index + 1} ${line}`);
l.bg.reset();
} else {
l.brightBlack().write(`${index + 1} `).red().write(` ${line}`)
l.reset().write(`${index + 1} `).red().write(` ${line}`)
}
l.write("\n").reset();
}
});
l.write("\n");
throw "";
}
}
}

0 comments on commit 0e730b7

Please sign in to comment.