Skip to content

Commit

Permalink
fix bulk warning spam (archiverjs#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka authored and ctalkington committed Dec 12, 2016
1 parent e7e6c0e commit 9f6d226
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ var Transform = require('readable-stream').Transform;

var win32 = process.platform === 'win32';

if (process._loggedBulkDeprecation === undefined) {
process._loggedBulkDeprecation = false;
}

/**
* @constructor
* @param {String} format The archive format to use.
Expand Down Expand Up @@ -60,8 +64,6 @@ var Archiver = function(format, options) {
};

this._streams = [];

this._loggedBulkDeprecation = false;
};

inherits(Archiver, Transform);
Expand Down Expand Up @@ -559,8 +561,8 @@ Archiver.prototype.append = function(source, data) {
* @return {this}
*/
Archiver.prototype.bulk = function(mappings) {
if (!this._loggedBulkDeprecation) {
this._loggedBulkDeprecation = true;
if (process._loggedBulkDeprecation === false) {
process._loggedBulkDeprecation = true;
var warning = 'Archiver.bulk() deprecated since 0.21.0';
if (typeof process !== 'undefined' && typeof process.emitWarning !== 'undefined') {
process.emitWarning(warning, 'DeprecationWarning');
Expand Down Expand Up @@ -901,4 +903,4 @@ module.exports = Archiver;
* when working with methods like `directory` or `glob`.
* @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing
* for reduction of fs stat calls when stat data is already known.
*/
*/

0 comments on commit 9f6d226

Please sign in to comment.