fn shell_diff(before: &str, after: &str, before_name: &str, after_name: &str) -> Result<bool> {
    let beforefilename = format!("{}.shipcat.gen.yml", before_name);
    let beforepth = Path::new(".").join(&beforefilename);
    debug!("Writing before to {}", beforepth.display());
    let mut f = File::create(&beforepth)?;
    writeln!(f, "{}", before)?;

    let afterfilename = format!("{}.shipcat.gen.yml", after_name);
    let afterpth = Path::new(".").join(&afterfilename);
    debug!("Writing after to {}", afterpth.display());
    let mut f = File::create(&afterpth)?;
    writeln!(f, "{}", after)?;

    let args = ["-u", &beforefilename, &afterfilename];
    debug!("diff {}", args.join(" "));
    let s = Command::new("diff").args(&args).status()?;
    // cleanup
    fs::remove_file(beforepth)?;
    fs::remove_file(afterpth)?;

    Ok(s.success())
}
// Compare using diff(1)
// difference libraries all seemed to be lacking somewhat
Compare using diff(1)
difference libraries all seemed to be lacking somewhat
Compare using diff ( 1 ) difference libraries all seemed to be lacking somewhat
fn shell_diff(before: &str, after: &str, before_name: &str, after_name: &str) -> Result<bool> {
    let beforefilename = format!("{}.shipcat.gen.yml", before_name);
    let beforepth = Path::new(".").join(&beforefilename);
    debug!("Writing before to {}", beforepth.display());
    let mut f = File::create(&beforepth)?;
    writeln!(f, "{}", before)?;
    let afterfilename = format!("{}.shipcat.gen.yml", after_name);
    let afterpth = Path::new(".").join(&afterfilename);
    debug!("Writing after to {}", afterpth.display());
    let mut f = File::create(&afterpth)?;
    writeln!(f, "{}", after)?;
    let args = ["-u", &beforefilename, &afterfilename];
    debug!("diff {}", args.join(" "));
    let s = Command::new("diff").args(&args).status()?;
    // cleanup
    fs::remove_file(beforepth)?;
    fs::remove_file(afterpth)?;
    Ok(s.success())
}
fn shell_diff ( before : & str , after : & str , before_name : & str , after_name : & str ) -> Result < bool > { let beforefilename = format ! ( " " before_name ) ; let beforepth = Path :: new ( " " ) . join ( & beforefilename ) ; debug ! ( " " beforepth display ( ) ) ; let mut f = File :: create ( & beforepth ) ? ; writeln ! ( f " " before ) ? ; let afterfilename = format ! ( " " after_name ) ; let afterpth = Path :: new ( " " ) . join ( & afterfilename ) ; debug ! ( " " afterpth display ( ) ) ; let mut f = File :: create ( & afterpth ) ? ; writeln ! ( f " " after ) ? ; let args = [ " " , & beforefilename , & afterfilename ] ; debug ! ( " " args join ( " " ) ) ; let s = Command :: new ( " " ) . args ( & args ) . status ( ) ? ; // cleanup fs :: remove_file ( beforepth ) ? ; fs :: remove_file ( afterpth ) ? ; Ok ( s . success ( ) ) }
Compare using diff(1)
difference libraries all seemed to be lacking somewhat
Compare using diff ( 1 ) difference libraries all seemed to be lacking somewhat
before
&str
after
&str
before_name
&str
after_name
&str
before
&str
after
&str
before_name
&str
after_name
&str