2 use crate::configuration::Configuration;
3 use std::process::{Command, Stdio};
5 const COMMAND: &str = "rsync";
10 pub fn new() -> Self {
15 impl super::Command for Publish {
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 blog");
26 .stdout(Stdio::null())
27 .stderr(Stdio::null())
29 .expect("Publishing requires rsync");
34 .arg(format!("{}/", &configuration.blog_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>\t\tPublishes the blog to a remote host"