feat: Add functionality to read path from stdin and rund tasks
This commit is contained in:
parent
43bea77392
commit
52dca1bcaf
5 changed files with 29 additions and 17 deletions
20
src/main.rs
20
src/main.rs
|
|
@ -1,3 +1,19 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
use std::{
|
||||
env::{self, args},
|
||||
fs,
|
||||
};
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let args: Vec<String> = env::args().collect();
|
||||
let path_to_workload = &args[1];
|
||||
|
||||
let json = fs::read_to_string(path_to_workload).unwrap();
|
||||
let workload = kauma::utils::parse::parse_json(json)?;
|
||||
|
||||
let response = kauma::tasks::task_distrubute(&workload);
|
||||
println!("{}", serde_json::to_string(&response)?);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue