Skip to content

Commit 079e682

Browse files
committed
fix: packages 引用忽略 .DS_Store
1 parent 21c7a9f commit 079e682

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/utils/global-state.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ async function initPackages(cliCurrentPath: string, preSelectPackage: string) {
7676
const currentPackagesPath = path.join(cliCurrentPath, PACKAGES_NAME);
7777

7878
if (fs.existsSync(currentPackagesPath)) {
79-
globalState.packages = fs.readdirSync(currentPackagesPath).map(folderName => {
79+
globalState.packages = fs.readdirSync(currentPackagesPath).filter(folderName=>{
80+
if (folderName==='.DS_Store'){
81+
return false
82+
}
83+
84+
return true
85+
}).map(folderName => {
8086
const packagePath = path.join(cliCurrentPath, PACKAGES_NAME, folderName);
8187
const packageJson: PackageJson = fs.readJSONSync(path.join(packagePath, 'package.json'), { throws: false });
8288

src/utils/packages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const getPackages = (() => {
3535
.filter(each => {
3636
return !!each;
3737
});
38+
3839
result = await Promise.all(
3940
submodulePaths.map(async submodulePath => {
4041
const packagesPathEndWithSep = packagesPath.dir.endsWith(path.sep)

0 commit comments

Comments
 (0)