Browse Source

Merge pull request #11 from zeithq/fix/skip-updates-on-no-tty

ignore update checking if no tty
master
Tony Kovanen 9 years ago
parent
commit
44b34a3956
  1. 12
      lib/check-update.js

12
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) => {

Loading…
Cancel
Save