-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathmain.rs
More file actions
26 lines (23 loc) · 837 Bytes
/
main.rs
File metadata and controls
26 lines (23 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use clap::Parser as _;
use vite_task::{Command, ExitStatus, Session};
use vite_task_bin::OwnedSessionConfig;
fn main() -> ! {
let exit_code: i32 =
tokio::runtime::Builder::new_multi_thread().enable_all().build().unwrap().block_on(async {
match run().await {
Ok(status) => i32::from(status.0),
#[expect(clippy::print_stderr, reason = "top-level error reporting")]
Err(err) => {
eprintln!("Error: {err:?}");
1
}
}
});
std::process::exit(exit_code);
}
async fn run() -> anyhow::Result<ExitStatus> {
let args = Command::parse();
let mut owned_config = OwnedSessionConfig::default();
let session = Session::init(owned_config.as_config())?;
Ok(session.main(args).await)
}