File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ use reqwest::{Client, get};
88use serde_json:: Value ;
99use serde_json:: Value :: Null ;
1010use std:: fs:: { File , read_dir} ;
11+ use std:: io;
1112use std:: io:: Write ;
1213use 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 ( )
You can’t perform that action at this time.
0 commit comments