-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #17!
- Loading branch information
Showing
2 changed files
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
//! Contains code related to writing `bevy_lint_driver`. | ||
use crate::callback::BevyLintCallback; | ||
use std::process::ExitCode; | ||
|
||
/// This is the main entrypoint into the driver, exported so that `bevy_cli` may call it. | ||
#[allow(clippy::result_unit_err)] | ||
pub fn main() -> Result<(), ()> { | ||
pub fn main() -> ExitCode { | ||
let args: Vec<String> = dbg!(std::env::args().skip(1).collect()); | ||
|
||
// Call the compiler with our custom callback. | ||
rustc_driver::RunCompiler::new(&args, &mut BevyLintCallback) | ||
.run() | ||
.map_err(|_| ()) | ||
let result = rustc_driver::RunCompiler::new(&args, &mut BevyLintCallback).run(); | ||
|
||
match result { | ||
Ok(_) => ExitCode::SUCCESS, | ||
Err(_) => ExitCode::FAILURE, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters