Skip to content

Commit

Permalink
fixed file-type detection method
Browse files Browse the repository at this point in the history
  • Loading branch information
QpxDesign committed Mar 8, 2024
1 parent bd81a55 commit ad985ef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
workspace = { members = [ "tests","tests/obfuscate_access_log_ips"] }
[package]
name = "ngxav"
version = "0.4.6"
version = "0.4.7"
edition = "2021"
license = "MIT"
description = "Search through NGINX logs with advanced filters and support for displaying analytics about your selected log entries"
Expand Down
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::structs::Args::ArgParser;
use crate::utils::parse_line::parse_line;

use std::{
fs::metadata,
fs::File,
io::{self, BufRead, BufReader, Write},
path::Path,
Expand Down Expand Up @@ -56,7 +57,8 @@ fn main() {
return;
}
let mut lines = Vec::new();
if args.file.contains("/") {
let file_md = metadata(args.file.clone()).unwrap();
if file_md.is_dir() {
lines = utils::read_folder::read_folder(args.file);
} else {
lines = lines_from_file(args.file).expect("should read");
Expand Down

0 comments on commit ad985ef

Please sign in to comment.