|
|
@ -2,7 +2,7 @@ use std::env;
|
|
|
|
use std::process::Command;
|
|
|
|
use std::process::Command;
|
|
|
|
|
|
|
|
|
|
|
|
use crate::info;
|
|
|
|
use crate::info;
|
|
|
|
use crate::{crash, internal::AppExitCode, log};
|
|
|
|
use crate::{crash, internal::AppExitCode, log, prompt};
|
|
|
|
|
|
|
|
|
|
|
|
struct PullParams {
|
|
|
|
struct PullParams {
|
|
|
|
smart_pull: bool,
|
|
|
|
smart_pull: bool,
|
|
|
@ -10,7 +10,7 @@ struct PullParams {
|
|
|
|
no_regen: bool,
|
|
|
|
no_regen: bool,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn do_the_pulling(repos: Vec<String>, verbose: bool, params: &PullParams) {
|
|
|
|
fn do_the_pulling(repos: Vec<String>, verbose: bool, params: &PullParams, no_confirm: bool) {
|
|
|
|
for repo in repos {
|
|
|
|
for repo in repos {
|
|
|
|
// Set root dir to return after each git pull
|
|
|
|
// Set root dir to return after each git pull
|
|
|
|
let root_dir = env::current_dir().unwrap();
|
|
|
|
let root_dir = env::current_dir().unwrap();
|
|
|
@ -54,10 +54,17 @@ fn do_the_pulling(repos: Vec<String>, verbose: bool, params: &PullParams) {
|
|
|
|
|
|
|
|
|
|
|
|
// If build_on_update is set, rebuild package
|
|
|
|
// If build_on_update is set, rebuild package
|
|
|
|
if params.build_on_update {
|
|
|
|
if params.build_on_update {
|
|
|
|
|
|
|
|
if no_confirm {
|
|
|
|
|
|
|
|
packages_to_rebuild.push(repo);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
let cont = prompt!(default true, "Rebuild package {}?", &repo);
|
|
|
|
|
|
|
|
if cont {
|
|
|
|
info!("Package {} updated, staging for rebuild", &repo);
|
|
|
|
info!("Package {} updated, staging for rebuild", &repo);
|
|
|
|
log!(verbose, "Pushing package {} to be rebuilt", &repo);
|
|
|
|
log!(verbose, "Pushing package {} to be rebuilt", &repo);
|
|
|
|
packages_to_rebuild.push(repo);
|
|
|
|
packages_to_rebuild.push(repo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// If there are no changes, alert the user
|
|
|
|
// If there are no changes, alert the user
|
|
|
|
info!("No changes to pull");
|
|
|
|
info!("No changes to pull");
|
|
|
@ -99,7 +106,13 @@ fn do_the_pulling(repos: Vec<String>, verbose: bool, params: &PullParams) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn pull(packages: Vec<String>, exclude: &[String], verbose: bool, no_regen: bool) {
|
|
|
|
pub fn pull(
|
|
|
|
|
|
|
|
packages: Vec<String>,
|
|
|
|
|
|
|
|
exclude: &[String],
|
|
|
|
|
|
|
|
verbose: bool,
|
|
|
|
|
|
|
|
no_regen: bool,
|
|
|
|
|
|
|
|
no_confirm: bool,
|
|
|
|
|
|
|
|
) {
|
|
|
|
// Read config file
|
|
|
|
// Read config file
|
|
|
|
let config = crate::parse_cfg(verbose);
|
|
|
|
let config = crate::parse_cfg(verbose);
|
|
|
|
log!(verbose, "Config: {:?}", config);
|
|
|
|
log!(verbose, "Config: {:?}", config);
|
|
|
@ -187,5 +200,6 @@ pub fn pull(packages: Vec<String>, exclude: &[String], verbose: bool, no_regen:
|
|
|
|
build_on_update,
|
|
|
|
build_on_update,
|
|
|
|
no_regen,
|
|
|
|
no_regen,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
no_confirm,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|