Skip to content

Commit

Permalink
Run linting and restructure code
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Nov 2, 2023
1 parent 40e0ced commit ff6d1fa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ repository = "https://github.com/thevickypedia/none-shall-pass-rustic"
#path = "src/main.rs"

[dependencies]
reqwest = { version = "0.11.22", features = ["blocking"] }
regex = "1.10.2"
glob = "0.3"
log = "0.4"
log = "0.4.20"
regex = "1.10.2"
env_logger = "0.10"
reqwest = { version = "0.11.22", features = ["blocking"] }
1 change: 1 addition & 0 deletions gen_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ unzip markdown.zip
cd Markdown_1.0.1 && mv Markdown.pl ../ && cd .. && rm -rf Markdown_1.0.1 markdown.zip
perl Markdown.pl --html4tags README.md > docs/index.html
rm Markdown.pl
cargo clippy --no-deps --fix --allow-dirty

# to convert more than one markdown file to html
# for i in ./*.md; do perl markdown.pl --html4tags $i > docs/${i%.*}.html; done;
2 changes: 1 addition & 1 deletion src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub fn run(command: &str) -> bool {
if output.success() {
true
} else {
warn!("WARNING: Command failed with an error code: {:?}", output.code());
warn!("Command failed with an error code: {:?}", output.code());
false
}
}
13 changes: 6 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
extern crate env_logger;
extern crate glob;
extern crate regex;
extern crate log;
extern crate env_logger;
extern crate regex;

use log::{debug, error, info, warn};
use std::env;
use std::path::Path;
use std::process::exit;
use std::thread;
use std::time::Instant;

use log::{error, info, warn};

mod lookup;
mod connection;
mod git;
Expand Down Expand Up @@ -58,13 +59,11 @@ fn main() {
let debug = &arguments[4];
if debug == "true" {
env::set_var("RUST_LOG", "debug");
env_logger::init();
debug!("Debug mode is enabled");
} else {
env::set_var("RUST_LOG", "info");
env_logger::init();
}
info!("Fail flag is set to {}", fail);
env_logger::init();
info!("fail flag: {}\tdebug flag: {}", fail, debug);
let wiki_path = format!("{}.wiki", repo);
let command = format!("git clone https://github.com/{}/{}.git", owner, wiki_path);
if git::run(command.as_str()) {
Expand Down

0 comments on commit ff6d1fa

Please sign in to comment.