Skip to content

Commit

Permalink
Commit from GitHub Actions (Format Nim Files)
Browse files Browse the repository at this point in the history
  • Loading branch information
kreatoo committed Aug 7, 2023
1 parent f2651bd commit ae70e80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion kpkg/commands/buildcmd.nim
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ proc build*(no = false, yes = false, root = "/",
err("please enter a package name", false)

try:
deps = dephandler(packages, bdeps = true, isBuild = true)&dephandler(packages, isBuild = true)
deps = dephandler(packages, bdeps = true, isBuild = true)&dephandler(
packages, isBuild = true)
except CatchableError:
raise

Expand Down
9 changes: 6 additions & 3 deletions kpkg/modules/dephandler.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ proc isIn(one: seq[string], two: seq[string]): bool =
return true
return false

proc dephandler*(pkgs: seq[string], ignoreDeps = @[" "], bdeps = false, isBuild = false): seq[string] =
proc dephandler*(pkgs: seq[string], ignoreDeps = @[" "], bdeps = false,
isBuild = false): seq[string] =
## takes in a seq of packages and returns what to install.
var deps: seq[string]
try:
Expand Down Expand Up @@ -40,13 +41,15 @@ proc dephandler*(pkgs: seq[string], ignoreDeps = @[" "], bdeps = false, isBuild
let deprf = parse_runfile(repo&"/"&dep)

if not isEmptyOrWhitespace(deprf.bdeps.join()) and isBuild:
deps.add(dephandler(@[dep], deps&ignoreDeps, bdeps = true, isBuild = true))
deps.add(dephandler(@[dep], deps&ignoreDeps,
bdeps = true, isBuild = true))

if dep in pkgs or dep in deps or isIn(deps, ignoreDeps) or
dep in ignoreDeps:
continue

deps.add(dephandler(@[dep], deps&ignoreDeps, bdeps = false, isBuild = isBuild))
deps.add(dephandler(@[dep], deps&ignoreDeps, bdeps = false,
isBuild = isBuild))

deps.add(dep)

Expand Down

0 comments on commit ae70e80

Please sign in to comment.