Set up initial structure for the nix builder.
This commit is contained in:
3
src/command/build/mod.rs
Normal file
3
src/command/build/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
mod runner;
|
||||
|
||||
pub(crate) use runner::run_build;
|
||||
29
src/command/build/runner.rs
Normal file
29
src/command/build/runner.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
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!()
|
||||
}
|
||||
Reference in New Issue
Block a user