Skip to content

Commit

Permalink
rework loader
Browse files Browse the repository at this point in the history
  • Loading branch information
froehlichA committed Apr 17, 2022
1 parent ae2a0b8 commit 7aefee1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/modpack/loader.nim
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## Exports `Loader` which specifies the modloader type for a given modpack.
##
## Pax currently has support for the Fabric & Forge modloaders and assumes that mods that work on one modloader
## do not work on another.
## Pax currently has support for the Fabric & Forge modloaders and assumes that
## mods that work on one modloader do not work on another.

import strformat, strutils
import std/[strformat, strutils]

type
Loader* = enum
Expand Down
9 changes: 2 additions & 7 deletions src/modpack/manifest.nim
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,10 @@ proc toManifestFile(json: JsonNode): Future[ManifestFile] {.async.} =
let addon = fetchAddon(result.projectId)
let addonFile = fetchAddonFile(result.projectId, result.fileId)
await addon and addonFile
if addon.read().isNone() or addonFile.read().isNone():
raise newException(
ValueError,
fmt"projectID {result.projectId} & fileID {result.fileId} are not correct!"
)
result.metadata.name = addon.read().get().name
result.metadata.name = addon.read().name
result.metadata.explicit = true
result.metadata.pinned = false
result.metadata.dependencies = addonFile.read().get().dependencies
result.metadata.dependencies = addonFile.read().dependencies
else:
result.metadata.name = json["__meta"]["name"].getStr()
result.metadata.explicit = json["__meta"]{"explicit"}.getBool(true)
Expand Down

0 comments on commit 7aefee1

Please sign in to comment.