@@ -102,10 +102,10 @@ static BUILTIN_COMMANDS: &[&str] = &["lint", "fmt", "build", "test", "doc", "lib
102102/// Errors from JavaScript resolvers are converted to specific error types
103103/// (e.g., `LintFailed`, `ViteError`) to provide better error messages.
104104#[ napi]
105- pub async fn run ( options : CliOptions ) -> Result < i32 > {
105+ pub async fn run ( options : CliOptions ) {
106106 let args = parse_args ( ) ;
107107 // Use provided cwd or current directory
108- let mut cwd = current_dir ( ) ? ;
108+ let mut cwd = current_dir ( ) . expect ( "Failed to get current directory" ) ;
109109 if let Some ( options_cwd) = options. cwd {
110110 cwd. push ( options_cwd) ;
111111 }
@@ -202,24 +202,24 @@ pub async fn run(options: CliOptions) -> Result<i32> {
202202 )
203203 . await ;
204204
205- dbg ! ( & result) ;
206-
207205 tracing:: debug!( "Result: {result:?}" ) ;
208206
209- match result {
210- Ok ( exit_status) => Ok ( exit_status. code ( ) . unwrap_or ( 1 ) ) ,
207+ let exit_code = match result {
208+ Ok ( exit_status) => exit_status. code ( ) . unwrap_or ( 1 ) ,
211209 Err ( e) => {
212210 match e {
213211 // Standard exit code for Ctrl+C
214- Error :: UserCancelled => Ok ( 130 ) ,
212+ Error :: UserCancelled => 130 ,
215213 _ => {
216214 // Convert Rust errors to NAPI errors for JavaScript
217215 tracing:: error!( "Rust error: {:?}" , e) ;
218- Err ( anyhow:: Error :: from ( e) . into ( ) )
216+ eprintln ! ( "[vite+] run error: {:?}" , e) ;
217+ 1
219218 }
220219 }
221220 }
222- }
221+ } ;
222+ std:: process:: exit ( exit_code) ;
223223}
224224
225225/// Convert JavaScript errors to Rust lint errors
0 commit comments