mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
fix: disable colour if stdout redirected
This commit is contained in:
@@ -3,7 +3,7 @@ Configuration
|
||||
--config <file> .......... alternate nodemon.json config file to use
|
||||
--exitcrash .............. exit on crash, allows nodemon to work with other watchers
|
||||
-i, --ignore ............. ignore specific files or directories
|
||||
--no-colors .............. disable color output
|
||||
--[no-]color ............. toggle color output
|
||||
--signal <signal> ........ use specified kill signal instead of default (ex. SIGTERM)
|
||||
-w, --watch dir........... watch directory "dir" or files. use once for each
|
||||
directory or file to watch
|
||||
|
||||
@@ -175,10 +175,18 @@ function nodemonOption(options, arg, eatNext) {
|
||||
options.ext = eatNext();
|
||||
} else
|
||||
|
||||
if (arg === '--no-colours' || arg === '--no-colors') {
|
||||
if (arg === '--no-colours' || arg === '--no-colors'
|
||||
|| arg === '--no-colour'
|
||||
|| arg === '--no-color') {
|
||||
options.colours = false;
|
||||
} else
|
||||
|
||||
if (arg === '--colours' || arg === '--colors'
|
||||
|| arg === '--colour'
|
||||
|| arg === '--color') {
|
||||
options.colours = true;
|
||||
} else
|
||||
|
||||
if (arg === '--signal' || arg === '-s') {
|
||||
options.signal = eatNext();
|
||||
} else
|
||||
|
||||
@@ -3,7 +3,7 @@ var ignoreRoot = require('ignore-by-default').directories();
|
||||
// default options for config.options
|
||||
module.exports = {
|
||||
restartable: 'rs',
|
||||
colours: true,
|
||||
colours: process.stdout.isTTY,
|
||||
execMap: {
|
||||
py: 'python',
|
||||
rb: 'ruby',
|
||||
|
||||
Reference in New Issue
Block a user