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("")) setEncryptionPassCommand(enc_conf{"encryption_passcommand"}.getStr(""))
proc parseConfigFile*(file: string): NorgConfig = proc parseConfigFile*(file: string): NorgConfig =
norg_config = newNorgConfig()
let in_conf = parsetoml.parseFile(file) let in_conf = parsetoml.parseFile(file)
norg_config.source_directories = parseSourceDirectories(in_conf) norg_config.source_directories = parseSourceDirectories(in_conf)
norg_config.repositories = parseRepositories(in_conf{"repositories"}) norg_config.repositories = parseRepositories(in_conf{"repositories"})

View file

@ -21,13 +21,14 @@ type
actions*: Actions actions*: Actions
args*: NorgArgs args*: NorgArgs
var norg_config*: NorgConfig
proc newNorgConfig*(): NorgConfig = proc newNorgConfig*(): NorgConfig =
var nc = NorgConfig() var nc = NorgConfig()
nc.maintenance = newMaintenance() nc.maintenance = newMaintenance()
return nc return nc
var norg_config*: NorgConfig = newNorgConfig()
#proc `$`*(c: NorgConfig): string = #proc `$`*(c: NorgConfig): string =
# var msg: string = "Source Dirs: " & $c.source_directories & "\r\n" # var msg: string = "Source Dirs: " & $c.source_directories & "\r\n"
# msg &= "Repositories: " & $c.repositories & "\r\n" # msg &= "Repositories: " & $c.repositories & "\r\n"

View file

@ -7,8 +7,8 @@ import utils/actions
proc start() = proc start() =
parseArgs() parseArgs()
norg_config = parseConfigFile(norg_args.config_file)
norg_config.args = norg_args 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: if norg_config.source_directories.len > 0 and norg_config.repositories.len > 0:
run_actions(norg_config.actions.before_everything) run_actions(norg_config.actions.before_everything)
for repo in norg_config.repositories: for repo in norg_config.repositories: