Skip to content

Commit

Permalink
check for addons folder
Browse files Browse the repository at this point in the history
fixes #1
  • Loading branch information
BrettMayson committed Jan 5, 2025
1 parent a8b86c5 commit a7e3836
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ fn main() {
let src_dir = std::env::args()
.nth(1)
.expect("Please provide the source directory");

// check for -v or other - flags
if src_dir.starts_with('-') {
if src_dir == "-v" {
println!("v{}", env!("CARGO_PKG_VERSION"));
std::process::exit(0);
}
println!("Unknown flag: {src_dir}");
std::process::exit(1);
}

let src_dir = std::path::Path::new(&src_dir);
if !src_dir.exists() || !src_dir.is_dir() {
println!("Source directory does not exist");
Expand All @@ -43,6 +54,12 @@ fn main() {
{
continue;
}

if !dir.path().join("addons").exists() {
println!("No addons folder in {}", dir.path().display());
continue;
}

let mut saw_ebo = false;
let mut saw_pbo = false;

Check warning on line 64 in src/main.rs

View workflow job for this annotation

GitHub Actions / clippy

binding's name is too similar to existing binding

warning: binding's name is too similar to existing binding --> src/main.rs:64:17 | 64 | let mut saw_pbo = false; | ^^^^^^^ | note: existing binding defined here --> src/main.rs:63:17 | 63 | let mut saw_ebo = false; | ^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#similar_names = note: `-W clippy::similar-names` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::similar_names)]`
let mut maybe_addons = Vec::new();
Expand Down

0 comments on commit a7e3836

Please sign in to comment.