norgbackup/norg/restic/mount.nim

13 lines
425 B
Nim
Raw Normal View History

2024-08-23 11:12:00 +02:00
import ../model/config_type
2024-08-23 11:30:36 +02:00
import execute
import strformat
2024-08-23 11:12:00 +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:
echo fmt"Mounted {repo.path} at {further_args[0]}"
2024-08-23 11:30:36 +02:00
else:
echo "Failed to mount ", repo.path