diff --git a/lib/check-update.js b/lib/check-update.js index 9d5eec3..ecdba9b 100644 --- a/lib/check-update.js +++ b/lib/check-update.js @@ -3,12 +3,24 @@ import pkg from '../../package'; // relative to `build/` :\ import fetch from 'node-fetch'; import chalk from 'chalk'; +const isTTY = process.stdout.isTTY; + +// if we're not in a tty the update checker +// will always return a resolved promise +const resolvedPromise = new Promise((resolve, reject) => resolve()); + /** * Configures auto updates. * Sets up a `exit` listener to report them. */ export default function checkUpdate (opts = {}) { + if (!isTTY) { + // don't attempt to check for updates + // if the user is piping or redirecting + return resolvedPromise; + } + let updateData; const update = check(opts).then((data) => {