2024-08-19 03:21:46 +02:00
|
|
|
import strutils
|
|
|
|
import strformat
|
|
|
|
|
2024-08-23 10:50:53 +02:00
|
|
|
import ../model/command_type
|
|
|
|
import ../utils/run
|
|
|
|
export run
|
2024-08-19 03:21:46 +02:00
|
|
|
|
2024-08-23 13:04:27 +02:00
|
|
|
proc genCommand*(cmd: string, repo: string, further_args: seq[string]): string =
|
|
|
|
let args = further_args.join(" ")
|
2024-08-19 03:21:46 +02:00
|
|
|
let cmd = fmt"{BORG_BIN} {cmd} {repo} {args}"
|
|
|
|
return cmd
|
|
|
|
|
2024-08-23 15:08:14 +02:00
|
|
|
proc genDeleteCommand*(cmd: string, repo: string, archive: string, further_args: seq[string]): string =
|
|
|
|
let args = further_args.join(" ")
|
|
|
|
let cmd = fmt"{BORG_BIN} {cmd} {repo} {archive} {args}"
|
|
|
|
return cmd
|
|
|
|
|