Skip to content

Commit

Permalink
refactor: move get overloads from config to run_management
Browse files Browse the repository at this point in the history
Allow the run_management module to use the get procs. We can't make
run_management import the config module because the latter already
imports run_management, and Nim doesn't support cyclic imports yet.

The config module already exports run_management, so this commit doesn't
affect other modules.
  • Loading branch information
ee7 committed Mar 28, 2024
1 parent 66a5bb4 commit d5bc6c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,3 @@ proc getPluginConfig*(name: string): Option[PluginSpec] =

var autoHelp*: string = ""
proc getAutoHelp*(): string = autoHelp

proc get*[T](chalkConfig: ChalkConfig, fqn: string): T =
get[T](chalkConfig.`@@attrscope@@`, fqn)

proc getOpt*[T](chalkConfig: ChalkConfig, fqn: string): Option[T] =
getOpt[T](chalkConfig.`@@attrscope@@`, fqn)
6 changes: 6 additions & 0 deletions src/run_management.nim
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ var
startTime* = getMonoTime().ticks()
contextDirectories: seq[string]

proc get*[T](chalkConfig: ChalkConfig, fqn: string): T =
get[T](chalkConfig.`@@attrscope@@`, fqn)

proc getOpt*[T](chalkConfig: ChalkConfig, fqn: string): Option[T] =
getOpt[T](chalkConfig.`@@attrscope@@`, fqn)

# This is for when we're doing a `conf load`. We force silence, turning off
# all logging of merit.
proc startTestRun*() =
Expand Down

0 comments on commit d5bc6c1

Please sign in to comment.