function archiveAction(command, options) {
  var verbose = options.verbose;


  return function () {
    return new Promise(function (resolve, reject) {
      if (!command.source || !command.destination) {
        if (verbose) {
          console.log('  - FileManagerPlugin: Warning - archive parameter has to be formated as follows: { source: <string>, destination: <string> }');
        }
        reject();
      }

      var fileRegex = /(\*|\{+|\}+)/g;
      var matches = fileRegex.exec(command.source);

      var isGlob = matches !== null;

      fs$3.lstat(command.source, function (sErr, sStats) {
        var output = fs$3.createWriteStream(command.destination);
        var archive = archiver(command.format, command.options);

        archive.on('error', function (err) {
          return reject(err);
        });
        archive.pipe(output);

        // Exclude destination file from archive
        var destFile = path$1.basename(command.destination);
        var globOptions = Object.assign({ ignore: destFile }, command.options.globOptions || {});

        if (isGlob) archive.glob(command.source, globOptions);else if (sStats.isFile()) archive.file(command.source, { name: path$1.basename(command.source) });else if (sStats.isDirectory()) archive.glob('**/*', {
          cwd: command.source,
          ignore: destFile
        });
        archive.finalize().then(function () {
          return resolve();
        });
      });
    });
  };
}
/**
 * Execute mkdir action
 *
 * @param {Object} command - Command data for given action
 * @return {Function|null} - Function that returns a promise or null
 */
Execute mkdir action
@param {Object} command - Command data for given action
@return {Function|null} - Function that returns a promise or null
Execute mkdir action @param { Object } command - Command data for given action @return { Function|null } - Function that returns a promise or null
function archiveAction(command, options) {
  var verbose = options.verbose;
  return function () {
    return new Promise(function (resolve, reject) {
      if (!command.source || !command.destination) {
        if (verbose) {
          console.log('  - FileManagerPlugin: Warning - archive parameter has to be formated as follows: { source: <string>, destination: <string> }');
        }
        reject();
      }
      var fileRegex = /(\*|\{+|\}+)/g;
      var matches = fileRegex.exec(command.source);
      var isGlob = matches !== null;
      fs$3.lstat(command.source, function (sErr, sStats) {
        var output = fs$3.createWriteStream(command.destination);
        var archive = archiver(command.format, command.options);
        archive.on('error', function (err) {
          return reject(err);
        });
        archive.pipe(output);
        var destFile = path$1.basename(command.destination);
        var globOptions = Object.assign({ ignore: destFile }, command.options.globOptions || {});
        if (isGlob) archive.glob(command.source, globOptions);else if (sStats.isFile()) archive.file(command.source, { name: path$1.basename(command.source) });else if (sStats.isDirectory()) archive.glob('**/*', {
          cwd: command.source,
          ignore: destFile
        });
        archive.finalize().then(function () {
          return resolve();
        });
      });
    });
  };
}
function archiveAction ( command , options ) { var verbose = options . verbose ; return function ( ) { return new Promise ( function ( resolve , reject ) { if ( ! command . source || ! command . destination ) { if ( verbose ) { console . log ( '  - FileManagerPlugin: Warning - archive parameter has to be formated as follows: { source: <string>, destination: <string> }' ) ; } reject ( ) ; } var fileRegex = / (\*|\{+|\}+) / g ; var matches = fileRegex . exec ( command . source ) ; var isGlob = matches !== null ; fs$3 . lstat ( command . source , function ( sErr , sStats ) { var output = fs$3 . createWriteStream ( command . destination ) ; var archive = archiver ( command . format , command . options ) ; archive . on ( 'error' , function ( err ) { return reject ( err ) ; } ) ; archive . pipe ( output ) ; var destFile = path$1 . basename ( command . destination ) ; var globOptions = Object . assign ( { ignore : destFile } , command . options . globOptions || { } ) ; if ( isGlob ) archive . glob ( command . source , globOptions ) ; else if ( sStats . isFile ( ) ) archive . file ( command . source , { name : path$1 . basename ( command . source ) } ) ; else if ( sStats . isDirectory ( ) ) archive . glob ( '**/*' , { cwd : command . source , ignore : destFile } ) ; archive . finalize ( ) . then ( function ( ) { return resolve ( ) ; } ) ; } ) ; } ) ; } ; }
Execute mkdir action
 @param {Object} command - Command data for given action
 @return {Function|null} - Function that returns a promise or null
Execute mkdir action @param { Object } command - Command data for given action @return { Function|null } - Function that returns a promise or null
// Exclude destination file from archive