Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
10af8659
...
10af8659596fdb70f197489ec23a2dc34427e238
authored
2013-05-27 18:14:58 -0300
by
renatodarrigo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update colorizer.js to check for ANSICON and have colors on Windows
1 parent
9b1a7263
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
modules/colorizer.js
modules/colorizer.js
View file @
10af865
...
...
@@ -80,7 +80,7 @@ var Colorizer = function Colorizer() {
* @return String
*/
this
.
colorize
=
function
colorize
(
text
,
styleName
,
pad
)
{
if
(
fs
.
isWindows
()
||
!
env
[
'ANSICON'
]
||
!
(
styleName
in
styles
))
{
if
(
(
fs
.
isWindows
()
&&
!
env
[
'ANSICON'
])
||
!
(
styleName
in
styles
))
{
return
text
;
}
return
this
.
format
(
text
,
styles
[
styleName
],
pad
);
...
...
@@ -94,7 +94,7 @@ var Colorizer = function Colorizer() {
* @return String
*/
this
.
format
=
function
format
(
text
,
style
,
pad
)
{
if
(
fs
.
isWindows
()
||
!
env
[
'ANSICON'
]
||
!
utils
.
isObject
(
style
))
{
if
(
(
fs
.
isWindows
()
&&
!
env
[
'ANSICON'
])
||
!
utils
.
isObject
(
style
))
{
return
text
;
}
var
codes
=
[];
...
...
Please
register
or
sign in
to post a comment