Skip to content

Commit

Permalink
added json text check
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayahhhmed committed Aug 31, 2024
1 parent 5039b1b commit d35544a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,19 @@ async fn handle_scrape_write_to_file() -> Result<(), Box<dyn Error>> {

async fn handle_batch_insert() -> Result<(), Box<dyn Error>> {
println!("Handling batch insert...");
if !Path::new("courses.txt").is_file() {
if !Path::new("courses.json").is_file() {
return Err(Box::new(std::io::Error::new(
ErrorKind::NotFound,
"courses.json doesn't exist, please run cargo r -- scrape".to_string(),
)));
}
if !Path::new("classes.txt").is_file() {
if !Path::new("classes.json").is_file() {
return Err(Box::new(std::io::Error::new(
ErrorKind::NotFound,
"classes.json doesn't exist, please run cargo r -- scrape".to_string(),
)));
}
if !Path::new("times.txt").is_file() {
if !Path::new("times.json").is_file() {
return Err(Box::new(std::io::Error::new(
ErrorKind::NotFound,
"times.json doesn't exist, please run cargo r -- scrape".to_string(),
Expand Down

0 comments on commit d35544a

Please sign in to comment.