diff --git a/norg/config/init.nim b/norg/config/init.nim index bfd1879..5b642ec 100644 --- a/norg/config/init.nim +++ b/norg/config/init.nim @@ -35,7 +35,6 @@ proc parseEncryption*(enc_conf: TomlValueRef) = setEncryptionPassCommand(enc_conf{"encryption_passcommand"}.getStr("")) proc parseConfigFile*(file: string): NorgConfig = - norg_config = newNorgConfig() let in_conf = parsetoml.parseFile(file) norg_config.source_directories = parseSourceDirectories(in_conf) norg_config.repositories = parseRepositories(in_conf{"repositories"}) diff --git a/norg/model/config_type.nim b/norg/model/config_type.nim index 5ae2cd3..bee2759 100644 --- a/norg/model/config_type.nim +++ b/norg/model/config_type.nim @@ -21,13 +21,14 @@ type actions*: Actions args*: NorgArgs -var norg_config*: NorgConfig proc newNorgConfig*(): NorgConfig = var nc = NorgConfig() nc.maintenance = newMaintenance() return nc +var norg_config*: NorgConfig = newNorgConfig() + #proc `$`*(c: NorgConfig): string = # var msg: string = "Source Dirs: " & $c.source_directories & "\r\n" # msg &= "Repositories: " & $c.repositories & "\r\n" diff --git a/norg/norg.nim b/norg/norg.nim index 6b51c98..d072f2f 100644 --- a/norg/norg.nim +++ b/norg/norg.nim @@ -7,8 +7,8 @@ import utils/actions proc start() = parseArgs() - norg_config = parseConfigFile(norg_args.config_file) norg_config.args = norg_args + norg_config = parseConfigFile(norg_args.config_file) if norg_config.source_directories.len > 0 and norg_config.repositories.len > 0: run_actions(norg_config.actions.before_everything) for repo in norg_config.repositories: