Skip to content

Commit

Permalink
fix: packages 引用忽略 .DS_Store
Browse files Browse the repository at this point in the history
  • Loading branch information
ascoders committed Oct 9, 2019
1 parent 21c7a9f commit 079e682
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils/global-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ async function initPackages(cliCurrentPath: string, preSelectPackage: string) {
const currentPackagesPath = path.join(cliCurrentPath, PACKAGES_NAME);

if (fs.existsSync(currentPackagesPath)) {
globalState.packages = fs.readdirSync(currentPackagesPath).map(folderName => {
globalState.packages = fs.readdirSync(currentPackagesPath).filter(folderName=>{
if (folderName==='.DS_Store'){
return false
}

return true
}).map(folderName => {
const packagePath = path.join(cliCurrentPath, PACKAGES_NAME, folderName);
const packageJson: PackageJson = fs.readJSONSync(path.join(packagePath, 'package.json'), { throws: false });

Expand Down
1 change: 1 addition & 0 deletions src/utils/packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const getPackages = (() => {
.filter(each => {
return !!each;
});

result = await Promise.all(
submodulePaths.map(async submodulePath => {
const packagesPathEndWithSep = packagesPath.dir.endsWith(path.sep)
Expand Down

0 comments on commit 079e682

Please sign in to comment.