hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/cli/commands/check.js
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-29 02:17:12 +0200
committerhachem <im@hachem.wtf>2026-08-29 02:17:12 +0200
commite56d21fa04450d118f76347a96a12d1d5477958f (patch)
tree06d590ef64153e2ab92306a4a7cc63d6fef47286 /cli/commands/check.js
parent43d92fd60d75c4a1260757c75b1e1eefc0ea8952 (diff)
setup: prepare go workspace
Diffstat (limited to 'cli/commands/check.js')
-rw-r--r--cli/commands/check.js81
1 files changed, 0 insertions, 81 deletions
diff --git a/cli/commands/check.js b/cli/commands/check.js
deleted file mode 100644
index f91b710..0000000
--- a/cli/commands/check.js
+++ /dev/null
@@ -1,81 +0,0 @@
-const { LoadConfig } = require("../../lib/config")
-const { GetModVersions, GetCompatibleVersion } = require("../../lib/modrinth")
-
-const config = LoadConfig()
-const { minecraft_version, modrinth_mods } = config
-
-const Check = async () =>
-{
- console.log(`\n Checking mod compatibility for MC ${minecraft_version} (Fabric)...\n`)
-
- const compatible = []
- const incompatible = []
- const failed = []
-
- for (const slug of modrinth_mods)
- {
- try
- {
- const versions = await GetModVersions(slug)
- if (!versions)
- {
- failed.push(slug)
- continue
- }
-
- const match = GetCompatibleVersion(versions, minecraft_version, "fabric")
- if (match)
- {
- const filename = match.files[0]?.filename || match.version_number
- compatible.push({ slug, version: filename })
- }
- else
- {
- incompatible.push(slug)
- }
- }
- catch (err)
- {
- failed.push(slug)
- }
- }
-
- // Display results
- if (compatible.length)
- {
- console.log(" [OK] Compatible:")
- for (const { slug, version } of compatible)
- console.log(` ${slug} -> ${version}`)
- console.log("")
- }
-
- if (incompatible.length)
- {
- console.log(" [FAIL] No compatible version:")
- for (const slug of incompatible)
- console.log(` ${slug}`)
- console.log("")
- }
-
- if (failed.length)
- {
- console.log(" [WARN] Failed to check:")
- for (const slug of failed)
- console.log(` ${slug}`)
- console.log("")
- }
-
- // Summary
- const total = modrinth_mods.length
- const ok = compatible.length
-
- console.log(` Summary: ${ok}/${total} mods compatible\n`)
-
- if (incompatible.length === 0 && failed.length === 0)
- console.log(" [OK] Safe to generate!\n")
- else
- console.log(" [FAIL] Not all mods are compatible. Generate may have issues.\n")
-}
-
-module.exports = { Check }
-