/// If successful returns the exit status of `ninja` and whether anything actually happened.
If successful returns the exit status of `ninja` and whether anything actually happened.
If successful returns the exit status of ` ninja ` and whether anything actually happened .
async fn run_once(
    matches: &ArgMatches,
    ditto_version: &Version,
    config_path: &Path,
    config: &Config,
    install_packages: bool,
) -> Result<WhatHappened> {
    // Need to acquire a lock on the build directory as lots of `ditto make`
    // processes running concurrently will cause problems!
    let lock = acquire_lock(config)?;
    debug!("Lock acquired");
    let include_test_stuff = !matches.is_present("no-tests");
    // Install/remove packages as needed
    // (this is a nicer pattern than requiring a run of a separate CLI command, IMO)
    if install_packages && !config.dependencies.is_empty() {
        pkg::check_packages_up_to_date(config, include_test_stuff)
            .await
            .wrap_err("error checking packages are up to date")?;
    }
    let now = Instant::now(); // for timing
    // Do the thing
    let result = make(config_path, config, ditto_version, include_test_stuff).await;
    lock.unlock()
        // Crash if we fail to release the lock otherwise things are likely to misbehave...
        .expect("Error releasing lock on build directory");
    debug!("make ran in {}ms", now.elapsed().as_millis());
    result
}
async fn run_once ( matches : & ArgMatches , ditto_version : & Version , config_path : & Path , config : & Config , install_packages : bool , ) -> Result < WhatHappened > { // Need to acquire a lock on the build directory as lots of `ditto make` // processes running concurrently will cause problems! let lock = acquire_lock ( config ) ? ; debug ! ( " " ) ; let include_test_stuff = ! matches . is_present ( " " ) ; // Install/remove packages as needed // (this is a nicer pattern than requiring a run of a separate CLI command, IMO) if install_packages && ! config . dependencies . is_empty ( ) { pkg :: check_packages_up_to_date ( config , include_test_stuff ) . await . wrap_err ( " " ) ? ; } let now = Instant :: now ( ) ; // for timing // Do the thing let result = make ( config_path , config , ditto_version , include_test_stuff ) . await ; lock . unlock ( ) // Crash if we fail to release the lock otherwise things are likely to misbehave... . expect ( " " ) ; debug ! ( " " now elapsed ( ) as_millis ( ) ) ; result }
If successful returns the exit status of `ninja` and whether anything actually happened.
If successful returns the exit status of ` ninja ` and whether anything actually happened .
matches
&ArgMatches
ditto_version
&Version
config_path
&Path
config
&Config
install_packages
bool