29 lines
695 B
Nim
29 lines
695 B
Nim
import ../model/config_type
|
|
import ../utils/actions
|
|
|
|
import init
|
|
import backup
|
|
import list
|
|
import mount
|
|
import extract
|
|
|
|
proc execute*(nc: NorgConfig, repo: Repository) =
|
|
case nc.args.command
|
|
of INIT:
|
|
discard initRepo(nc, repo)
|
|
of CREATE:
|
|
run_actions(norg_config.actions.before_backup)
|
|
discard createBackup(nc, repo)
|
|
run_actions(norg_config.actions.after_backup)
|
|
of LIST:
|
|
discard listArchives(nc, repo)
|
|
of MOUNT:
|
|
discard mountArchive(nc, repo)
|
|
of UMOUNT:
|
|
discard unmountArchive(nc)
|
|
of EXTRACT:
|
|
run_actions(norg_config.actions.before_extract)
|
|
discard extractArchive(nc, repo)
|
|
run_actions(norg_config.actions.after_extract)
|
|
else:
|
|
discard
|