19 lines
686 B
Nim
19 lines
686 B
Nim
import ../model/config_type
|
|
import execute
|
|
import strformat
|
|
|
|
proc mountArchive*(nc: NorgConfig, repo: Repository): int =
|
|
let archive = fmt"{repo.path}::{nc.args.archive}"
|
|
let further_args = nc.args.further_args
|
|
let ok = runDiscard genCommand(cmd = "mount", repo = archive, further_args = further_args)
|
|
if ok == 0:
|
|
echo fmt"Mounted {archive} at {further_args[0]}"
|
|
else:
|
|
echo "Failed to mount ", archive
|
|
|
|
proc unmountArchive*(nc: NorgConfig): int =
|
|
let ok = runDiscard genCommand(cmd = "umount", repo = "", further_args = nc.args.further_args)
|
|
if ok == 0:
|
|
echo "Unmounted ", nc.args.further_args[0]
|
|
else:
|
|
echo "Failed to unmount ", nc.args.further_args[0]
|