@tutinoko2048/mcutil 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -183,11 +183,12 @@ async function detectPackageManagers(cwd) {
183
183
  ];
184
184
  const matches = [];
185
185
  await Promise.all(checks.map(async (check) => {
186
- try {
187
- await Promise.all(check.files.map((file) => fs.access(path.join(cwd, file))));
186
+ for (const file of check.files) try {
187
+ await fs.access(path.join(cwd, file));
188
188
  matches.push(check.name);
189
+ break;
189
190
  } catch {
190
- return;
191
+ continue;
191
192
  }
192
193
  }));
193
194
  return matches;
@@ -356,7 +357,7 @@ function registerPkgCommand(program) {
356
357
 
357
358
  //#endregion
358
359
  //#region package.json
359
- var version = "1.0.3";
360
+ var version = "1.0.4";
360
361
 
361
362
  //#endregion
362
363
  //#region src/cli.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tutinoko2048/mcutil",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/cli.mjs",
@@ -104,11 +104,14 @@ async function detectPackageManagers(cwd: string): Promise<PackageManager[]> {
104
104
  const matches: PackageManager[] = [];
105
105
  await Promise.all(
106
106
  checks.map(async (check) => {
107
- try {
108
- await Promise.all(check.files.map(file => fs.access(path.join(cwd, file))));
109
- matches.push(check.name);
110
- } catch {
111
- return;
107
+ for (const file of check.files) {
108
+ try {
109
+ await fs.access(path.join(cwd, file));
110
+ matches.push(check.name);
111
+ break;
112
+ } catch {
113
+ continue;
114
+ }
112
115
  }
113
116
  })
114
117
  );