30 lines
840 B
Rust
30 lines
840 B
Rust
|
|
use crate::cli::parameters::BuildArgs;
|
||
|
|
use crate::config::Config;
|
||
|
|
use crate::config::TargetConfig;
|
||
|
|
use crate::error::CustomError;
|
||
|
|
|
||
|
|
pub(crate) async fn run_build(args: BuildArgs) -> Result<(), CustomError> {
|
||
|
|
println!("{:?}", args);
|
||
|
|
let config = Config::load_from_file(args.config).await?;
|
||
|
|
println!("{:?}", config);
|
||
|
|
|
||
|
|
for target_name in args.target {
|
||
|
|
let target_config = {
|
||
|
|
let target_config = config.get_target_config(&target_name)?;
|
||
|
|
if let Some(conf) = target_config {
|
||
|
|
conf
|
||
|
|
} else {
|
||
|
|
return Err(format!("Could not find target {}", target_name).into());
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
prepare_flake_repo(target_config).await?;
|
||
|
|
}
|
||
|
|
|
||
|
|
Ok(())
|
||
|
|
}
|
||
|
|
|
||
|
|
async fn prepare_flake_repo(target_config: &TargetConfig) -> Result<(), CustomError> {
|
||
|
|
todo!()
|
||
|
|
}
|