2 use crate::configuration::Configuration;
3 use std::process::{Command, Stdio};
5 const COMMAND: &str = "rsync";
7 pub struct PublishArchive;
10 pub fn new() -> Self {
15 impl super::Command for PublishArchive {
16 fn before_dependencies(&self) -> Vec<Box<dyn super::Command>> {
20 fn execute(&self, input: Option<&String>, configuration: &Configuration, _: &String) -> Result<()> {
22 let input = input.expect("You must provide a location to publish the archive");
26 .stdout(Stdio::null())
27 .stderr(Stdio::null())
29 .expect("Publishing requires rsync");
34 .arg(format!("{}/", &configuration.archive_output_directory.display()))
36 .stdout(Stdio::null())
37 .stderr(Stdio::null())
39 .expect("Publishing requires rsync");
43 fn after_dependencies(&self) -> Vec<Box<dyn super::Command>> {
47 fn command(&self) -> &'static str {
51 fn help(&self) -> &'static str {
52 "<destination>\tPublishes the archive to a remote host"