Browse Source

get-files: side-loading of `pkg` to avoid double fs lookups

master
Guillermo Rauch 9 years ago
parent
commit
43734fe951
  1. 6
      lib/get-files.js

6
lib/get-files.js

@ -14,9 +14,11 @@ import IGNORED from './ignored';
* @return {Array} comprehensive list of paths to sync
*/
export default async function getFiles (path) {
export default async function getFiles (path, pkg) {
if (!pkg) {
const pkgData = await read(resolve(path, 'package.json'), 'utf8');
const pkg = JSON.parse(pkgData);
pkg = JSON.parse(pkgData);
}
let search = (pkg.files || ['.']).concat('package.json');
if (pkg.main) search = search.concat(pkg.main);

Loading…
Cancel
Save