norgbackup/norg/restic/mount.nim

15 lines
452 B
Nim
Raw Permalink Normal View History

2024-08-23 11:12:00 +02:00
import ../model/config_type
import ../model/log_type
2024-08-23 11:30:36 +02:00
import execute
import strformat
2024-08-23 11:12:00 +02:00
2024-08-27 22:16:31 +02:00
2024-08-23 11:30:36 +02:00
proc mountSnapshot*(nc: NorgConfig, repo: Repository): int =
#let further_args = nc.args.further_args[1..^1]
let further_args = nc.args.further_args
let ok = runDiscard genCommand(cmd = "mount", repo = repo.path, further_args = further_args)
2024-08-23 11:30:36 +02:00
if ok == 0:
2024-08-27 22:16:31 +02:00
info fmt"Mounted {repo.path} at {further_args[0]}"
2024-08-23 11:30:36 +02:00
else:
2024-08-27 22:16:31 +02:00
error "Failed to mount ", repo.path