Skip to content

Commit

Permalink
Travis is no longer a TTY
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Mar 16, 2015
1 parent 0de8831 commit 70ae34b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
13 changes: 12 additions & 1 deletion src/lib/util.coffee
Expand Up @@ -28,9 +28,20 @@ module.exports = docpadUtil =
# Wait
wait: (time, fn) -> setTimeout(fn, time)

# Get Default Log Level
getDefaultLogLevel: ->
if docpadUtil.isTravis() or ('-d' in process.argv)
return 7
else
return 5

# Is Travis
isTravis: ->
return process.env.TRAVIS_NODE_VERSION?

# Is TTY
isTTY: ->
return process.stdout?.isTTY is true and process.stderr?.isTTY is true
return docpadUtil.isTravis() is false and process.stdout?.isTTY is true and process.stderr?.isTTY is true

# Inspect
inspect: (obj, opts) ->
Expand Down
3 changes: 2 additions & 1 deletion src/test/actions-test.coffee
Expand Up @@ -15,6 +15,7 @@ _ = require('lodash')

# Local
DocPad = require('../lib/docpad')
docpadUtil = require('../lib/util')


# -------------------------------------
Expand All @@ -39,7 +40,7 @@ docpadConfig =
port: port
hostname: hostname
rootPath: rootPath
logLevel: if (process.env.TRAVIS_NODE_VERSION? or '-d' in process.argv) then 7 else 5
logLevel: docpadUtil.getDefaultLogLevel()
skipUnsupportedPlugins: false
catchExceptions: false
environments:
Expand Down
5 changes: 4 additions & 1 deletion src/test/api-test.coffee
Expand Up @@ -8,6 +8,9 @@ pathUtil = require('path')
{equal} = require('assert-helpers')
joe = require('joe')

# Local
docpadUtil = require('../lib/util')


# =====================================
# Configuration
Expand All @@ -24,7 +27,7 @@ docpadConfig =
action: false
port: 9780
rootPath: rootPath
logLevel: if (process.env.TRAVIS_NODE_VERSION? or '-d' in process.argv) then 7 else 5
logLevel: docpadUtil.getDefaultLogLevel()
skipUnsupportedPlugins: false
catchExceptions: false
environments:
Expand Down
2 changes: 1 addition & 1 deletion src/test/server-test.coffee
Expand Up @@ -44,7 +44,7 @@ joe.suite 'docpad-custom-server', (suite,test) ->
docpadConfig =
port: port = 9780
rootPath: rootPath
logLevel: if (process.env.TRAVIS_NODE_VERSION? or '-d' in process.argv) then 7 else 5
logLevel: docpadUtil.getDefaultLogLevel()
skipUnsupportedPlugins: false
catchExceptions: false
serverExpress: serverExpress = require('express')()
Expand Down

0 comments on commit 70ae34b

Please sign in to comment.