2024-08-23 11:12:00 +02:00
|
|
|
import ../model/config_type
|
2024-08-27 22:39:21 +02:00
|
|
|
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 =
|
2024-08-23 13:04:27 +02:00
|
|
|
#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
|