From 079e682de5502a75b596d53179d7602944175606 Mon Sep 17 00:00:00 2001 From: ascoders <576625322@qq.com> Date: Wed, 9 Oct 2019 15:04:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20packages=20=E5=BC=95=E7=94=A8=E5=BF=BD?= =?UTF-8?q?=E7=95=A5=20.DS=5FStore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/global-state.ts | 8 +++++++- src/utils/packages.ts | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/utils/global-state.ts b/src/utils/global-state.ts index 2f9d0116..ab53009c 100644 --- a/src/utils/global-state.ts +++ b/src/utils/global-state.ts @@ -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 }); diff --git a/src/utils/packages.ts b/src/utils/packages.ts index 83d8c405..b5c62a62 100644 --- a/src/utils/packages.ts +++ b/src/utils/packages.ts @@ -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)