Restic init, list, backup, mount and restore working

This commit is contained in:
Paul Wilde 2024-08-23 13:29:02 +01:00
parent 7654fc04bf
commit 1007797119
3 changed files with 3 additions and 3 deletions

View file

@ -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"})

View file

@ -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"

View file

@ -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: