Expand globs into paths.

@param {Object} opts
@param {Function} done
546898
function resolve(opts, done) {
  debug('resolving paths for globs:\n', JSON.stringify(opts.globs));
  var tasks = opts.globs.map(function(pattern) {
    return function(cb) {
      debug('resolving `%s`...', pattern);
      glob(pattern, {}, function(err, files) {
        if (err) {
          return cb(err);
        }
        debug('resolved %d file(s) for `%s`', files.length, pattern);
        if (files.length > 0) {
          opts.files.push.apply(opts.files, files);
        }
        cb();
      });
    };
  });
  async.parallel(tasks, function(err) {
    if (err) {
      return done(err);
    }
    debug('checking and removing duplicate paths...');
    opts.files = unique(opts.files);
    debug('final result has `%d` files', opts.files.length);
    done(null, opts.files);
  });
}
507674
function addFiles(sources, dest, options) {
      var opt = _.extend({}, defaultOptions, options || {});

      if(_.isString(sources)) {
        sources = [sources];
      }

      if(!inCwd(dest) || _.any(sources, function(src) {
        return !inCwd(src);
      })) {
        grunt.verbose.writeln('Ignore %s to %s: not in CWD.');
        return;
      }

      return addToQueueCopy(sources, dest, opt);
    }
410969
function(opt){
        // merge with default options
        Object.keys(_options).forEach(function(key){
            _options[key] = opt[key] || _options[key];
        });
    }
303260
def _expand_directories(paths):
    """"""
    for path in paths:
        path_ = Path(path)
        if path_.is_dir():
            for expanded in path_.rglob('*'):
                yield str(expanded)
        else:
            yield path
444098
function convertGlobPaths(globs) {
  return globs
    .map(globString => glob.sync(globString))
    .reduce((previous, current) => previous.concat(current), []);
}
732084
def _expand_paths_itr(paths, marker='*'):
    
    for path in paths:
        if is_path(path):
            if marker in path:  # glob path pattern
                for ppath in sglob(path):
                    yield ppath
            else:
                yield path  # a simple file path
        elif is_path_obj(path):
            if marker in path.as_posix():
                for ppath in sglob(path.as_posix()):
                    yield normpath(ppath)
            else:
                yield normpath(path.as_posix())
        elif is_ioinfo(path):
            yield path.path
        else:  # A file or file-like object
            yield path
812909
function _Glob (pattern, options, callback, shouldIgnore) {
  // We don't put this thing to argument `options` to avoid
  // further problems, such as `options` validation.

  // Use `Symbol` as much as possible to avoid confliction.
  this[IGNORE] = shouldIgnore
  Glob.call(this, pattern, options, callback)
}
1293663
function (fp, opts) {
    var dest = path.resolve(this.dest(fp || this.path, opts));
    var file = { contents: this.content, path: dest };
    opts = extend({ ask: true, silent: false }, this.options, opts);

    utils.detect(file, opts, function (err) {
      if (file.contents) {
        utils.writeSync(dest, file.contents);
        utils.success('file written to', utils.bold(dest));
      } else {
        utils.copy.sync(this.path, dest);
        utils.success('file copied to', utils.bold(dest));
      }
    });
    return this;
  }
266091
function createFileDecoder(path, opts) {
  return fs.createReadStream(path)
    .pipe(new containers.streams.BlockDecoder(opts));
}
1073711
function normalize(opts) {
	if (typeof opts === 'string') {
		opts = {path: opts};
	}
	opts.path = path.resolve(opts.path);
	return opts;
}
1177839
function globify (args) {
  let parsed = new ParsedArgs(args);
  let expandGlob = parsed.args[parsed.globIndex];
  let renameOutfile = parsed.args[parsed.outfileIndex];
  let files = expandGlob && expandGlob(parsed.globOptions);

  if (!expandGlob) {
    // No glob patterns were found, so just run browserify as-is
    if (renameOutfile) {
      parsed.args[parsed.outfileIndex] = renameOutfile();
    }
    browserify(parsed.cmd, parsed.args);
  }
  else if (!renameOutfile) {
    // Run browserify with the expanded list of file names
    Array.prototype.splice.apply(parsed.args, [parsed.globIndex, 1].concat(files));
    browserify(parsed.cmd, parsed.args);
  }
  else {
    // Run browserify separately for each file
    files.forEach((file) => {
      let fileArgs = parsed.args.slice();
      fileArgs[parsed.globIndex] = file;
      fileArgs[parsed.outfileIndex] = renameOutfile(file, parsed.baseDir);
      browserify(parsed.cmd, fileArgs);
    });
  }
}
1340039
function gulp(opts) {
  opts = opts || {};

  var failOnError = opts['failOnError'] || false;
  var interimFiles = [];
  var failedValidations = [];

  return Through(
    function (file) {
      interimFiles.push(file.path);
      this.queue(file);
    },
    function () {
      var baseFile = opts.packageFile;

      interimFiles.forEach(function (file) {
        opts.packageFile = file;

        var results = validate(opts);

        if (hasErrors(results)) {
          failedValidations.push(file);
          log(results);
        }
      });

      opts.packageFile = baseFile;

      if (failOnError &&  failedValidations.length) {
        this.emit('error', new PluginError('dep-validate', 'Unable to validate dependencies'));
      } else {
        this.emit('end');
      }
    }
  );
}
781443
function( patterns, options ){

        options = options || {};

        var deferred = Q.defer(),
            updateHTMLFile = this.updateHTMLFile,
            results = {
                success: [],
                error: []
            };

        globby( patterns, options, function( err, files ){
            if( err ){
                deferred.reject( err );
                return;
            }

            files.reduce( function( previousUpdating, currentTargetFilePath ){
                return previousUpdating.then(
                    function( previousPath ){
                        if( previousPath ){
                            results.success.push( previousPath );
                        }
                        return updateHTMLFile( currentTargetFilePath );
                    }
                );
            }, Q() )
                .then(
                    function( lastPath ){
                        results.success.push( lastPath );
                        deferred.resolve( results );
                    },
                    function( e ){
                        deferred.reject( e );
                    }
                );
        } );

        return deferred.promise;
    }
406002
function runGlob(args, opts, cb) {
  var dotIdx = args.indexOf('.');
  if (dotIdx !== -1) {
    args.splice(dotIdx, 1);
  }
  glob(args, opts, function(err, globbed) {
    if (Array.isArray(globbed) && dotIdx !== -1) globbed.push('.');
    cb(err, globbed);
  });
}
917627
function augment(_opts) {
         var opts = _opts || {};
         opts.createFolders = opts.createFolders || true;
         return opts;
     }
286816
function (o, cb) {
    if (!o.src) {
      throw new Error('glob missing');
    }
    if (!o.out) {
      throw new Error('output dir missing');
    }

    var opts = _.extend({}, defaults, o);
    if (opts.style && path.basename(opts.style).indexOf('.') === -1) {
      opts.style = path.join(opts.style, replaceExtension(opts.name, '.' + opts.processor));
    }
    vfs.src(opts.src)
      .pipe(sprite(opts))
      .pipe(through2.obj(writeFile))
      .on('data', noop)
      .on('end', function () {
        if (_.isFunction(cb)) {
          cb();
        }
      });
  }
651533
function ExpandFiles(options) {
  if (!(this instanceof ExpandFiles)) {
    return new ExpandFiles(options);
  }

  Base.call(this, {}, options);
  this.use(utils.plugins());
  this.is('Files');

  this.options = options || {};
  if (util.isFiles(options) || arguments.length > 1) {
    this.options = {};
    this.expand.apply(this, arguments);
    return this;
  }
}