@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 +5 -4
- package/package.json +1 -1
- package/src/commands/pkg.ts +8 -5
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
|
|
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
|
-
|
|
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.
|
|
360
|
+
var version = "1.0.4";
|
|
360
361
|
|
|
361
362
|
//#endregion
|
|
362
363
|
//#region src/cli.ts
|
package/package.json
CHANGED
package/src/commands/pkg.ts
CHANGED
|
@@ -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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
);
|