--wip-- [skip ci]

This commit is contained in:
2026-08-22 02:01:06 +02:00
parent 1d5a4c61be
commit 8c7fafe846
4 changed files with 17 additions and 2 deletions
BIN
View File
Binary file not shown.
+2
View File
@@ -49,4 +49,6 @@ pub enum Commands {
Generate,
/// Generate completions for your current shell
ShellCompletions,
/// Test
Serve,
}
+14 -2
View File
@@ -6,7 +6,8 @@ use clap::{CommandFactory, Parser};
use clap_complete::{Shell, generate as generate_complete};
use crete::cluster::Cluster;
use crete::environment::PathEnvironment;
use crete::{get_configs_path, get_repo_path, set_repo_path};
use crete::tftp::ServerError;
use crete::{get_configs_path, get_repo_path, set_repo_path, tftp};
use minijinja::context;
use thiserror::Error;
@@ -16,6 +17,8 @@ use crate::cli::{Cli, Commands, GlobalOpts};
enum Error {
#[error("No clusters where found")]
NoClustersFound,
#[error("Server error: {0}")]
Server(#[from] ServerError),
}
fn run_command(mut command: Command) {
@@ -79,7 +82,8 @@ fn generate(opts: &GlobalOpts) -> Result<(), Error> {
Ok(())
}
fn main() -> Result<(), Error> {
#[tokio::main]
async fn main() -> Result<(), Error> {
let cli = Cli::parse();
match cli.command {
@@ -90,6 +94,14 @@ fn main() -> Result<(), Error> {
"crete",
&mut std::io::stdout(),
),
Commands::Serve => {
tftp::serve(|filename| match filename {
"ipxe.pxe" => Some(include_bytes!("../bin/ipxe.pxe").into()),
"test" => Some(vec![1, 2, 3, 4]),
_ => None,
})
.await?
}
};
Ok(())
+1
View File
@@ -0,0 +1 @@