Skip to content

Commit 4883bd4

Browse files
committed
fixes #6
1 parent db15ef0 commit 4883bd4

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/main.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use reqwest::{Client, get};
88
use serde_json::Value;
99
use serde_json::Value::Null;
1010
use std::fs::{File, read_dir};
11+
use std::io;
1112
use std::io::Write;
1213
use std::path::Path;
1314

@@ -43,6 +44,21 @@ async fn main() {
4344
search_result["hits"][0]["versions"].as_array().unwrap(),
4445
None,
4546
) {
47+
let title = &search_result["hits"][0]["title"];
48+
println!(
49+
"Fabric project {title} found from mod {fabricmod_id} do you want to download it? (Y/N)"
50+
);
51+
let mut input: String = String::new();
52+
io::stdin()
53+
.read_line(&mut input)
54+
.expect("Unable to read Stdin");
55+
if input.trim() == "Y" || input.trim() == "y" {
56+
println!("Continuing with download for {title}");
57+
} else {
58+
println!("Skipping download for {title}");
59+
continue;
60+
}
61+
4662
search_result["hits"][0]["project_id"]
4763
.as_str()
4864
.unwrap()

0 commit comments

Comments
 (0)