Skip to content

Commit

Permalink
do not require version & author when loading modpack - fixes #62
Browse files Browse the repository at this point in the history
  • Loading branch information
maradotwebp committed Dec 4, 2021
1 parent 2886b61 commit dfc835c
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modpack/manifest.nim
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ converter toManifest(json: JsonNode): Manifest =
## creates a Manifest from manifest json
result = Manifest()
result.name = json["name"].getStr()
result.author = json["author"].getStr()
result.version = json["version"].getStr()
result.author = json{"author"}.getStr()
result.version = json{"version"}.getStr()
result.mcVersion = json["minecraft"]["version"].getStr().Version
result.mcModloaderId = json["minecraft"]["modLoaders"][0]["id"].getStr()
let fileElemRequests = json["files"].getElems().map(toManifestFile)
Expand Down
52 changes: 52 additions & 0 deletions tests/cmd/tlist/tlist_without_version.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
discard """
cmd: "nim $target --hints:on -d:testing -d:ssl --nimblePath:tests/deps $options $file"
joinable: false
batchable: false
outputsub: '''
[Ξ”] ALL MODS (1)
└─ ‒↑ Just Enough Items (JEI) - https://www.curseforge.com/minecraft/mc-mods/jei/files/3383205
└─ β€’ The installed mod is compatible with the modpack's minecraft version.
└─ ↑ There is a newer version of this mod available.
'''
"""

import json, os
import cmd/list, term/color

terminalColorEnabledSetting = false

block:
removeDir("./modpack/")

let manifestJson = %* {
"minecraft": {
"version": "1.16.5",
"modLoaders": [
{
"id": "forge-36.1.0",
"primary": true
}
]
},
"manifestType": "minecraftModpack",
"overrides": "overrides",
"manifestVersion": 1,
"author": "testauthor",
"name": "testmodpack123",
"files": [
{
"projectID": 238222,
"fileID": 3383205,
"required": true,
"__meta": {
"name": "Just Enough Items (JEI)",
"explicit": true,
"dependencies": []
}
}
]
}

createDir("./modpack")
writeFile("./modpack/manifest.json", manifestJson.pretty)
paxList(status = true, info = false)

0 comments on commit dfc835c

Please sign in to comment.