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