11use crate :: logging:: ask_value;
22use crate :: mod_file:: { PlatformName , ToGeodeString } ;
3- use crate :: util:: mod_file:: { DependencyImportance , GDVersion } ;
3+ use crate :: util:: mod_file:: GDVersion ;
44use crate :: { done, fail, fatal, index, info, warn, NiceUnwrap } ;
55use crate :: {
66 file:: read_dir_recursive,
@@ -158,10 +158,7 @@ impl Found {
158158 }
159159}
160160
161- fn find_existing_dependency (
162- dep : & Dependency ,
163- _config : & Config ,
164- ) -> Result < Found , String > {
161+ fn find_existing_dependency ( dep : & Dependency , _config : & Config ) -> Result < Found , String > {
165162 let mut path = env:: temp_dir ( ) ;
166163 path. push ( format ! ( "{}.geode" , dep. id) ) ;
167164
@@ -302,30 +299,28 @@ pub fn check_dependencies(
302299 // Check if platform is supported
303300 match mod_info. gd {
304301 GDVersion :: Simple ( _) => { }
305- GDVersion :: Detailed ( gd) => {
306- match platform {
307- PlatformName :: Windows => {
308- if gd. win . is_none ( ) {
309- fatal ! ( "Geometry Dash version not specified for Windows, please specify one in mod.json" ) ;
310- }
302+ GDVersion :: Detailed ( gd) => match platform {
303+ PlatformName :: Windows => {
304+ if gd. win . is_none ( ) {
305+ fatal ! ( "Geometry Dash version not specified for Windows, please specify one in mod.json" ) ;
311306 }
312- PlatformName :: MacOS | PlatformName :: MacArm | PlatformName :: MacIntel => {
313- if gd . mac . is_none ( ) {
314- fatal ! ( "Geometry Dash version not specified for macOS, please specify one in mod.json" ) ;
315- }
307+ }
308+ PlatformName :: MacOS | PlatformName :: MacArm | PlatformName :: MacIntel => {
309+ if gd . mac . is_none ( ) {
310+ fatal ! ( "Geometry Dash version not specified for macOS, please specify one in mod.json" ) ;
316311 }
317- PlatformName :: Android | PlatformName :: Android32 | PlatformName :: Android64 => {
318- if gd . android . is_none ( ) {
319- fatal ! ( "Geometry Dash version not specified for Android, please specify one in mod.json" ) ;
320- }
312+ }
313+ PlatformName :: Android | PlatformName :: Android32 | PlatformName :: Android64 => {
314+ if gd . android . is_none ( ) {
315+ fatal ! ( "Geometry Dash version not specified for Android, please specify one in mod.json" ) ;
321316 }
322- PlatformName :: Ios => {
323- if gd . ios . is_none ( ) {
324- fatal ! ( "Geometry Dash version not specified for iOS, please specify one in mod.json" ) ;
325- }
317+ }
318+ PlatformName :: Ios => {
319+ if gd . ios . is_none ( ) {
320+ fatal ! ( "Geometry Dash version not specified for iOS, please specify one in mod.json" ) ;
326321 }
327322 }
328- }
323+ } ,
329324 }
330325
331326 // If no dependencies, skippy wippy
@@ -437,8 +432,7 @@ pub fn check_dependencies(
437432 info ! ( "Dependency '{}' found in cache" , dep. id) ;
438433 path_to_dep_geode = inst_path;
439434 _geode_info = inst_info;
440- }
441- else {
435+ } else {
442436 // check index
443437 let found_in_index = match find_index_dependency ( dep, & config) {
444438 Ok ( f) => f,
@@ -456,7 +450,7 @@ pub fn check_dependencies(
456450 if !matches ! ( found_in_index, Found :: Some ( _, _) )
457451 && !matches ! ( found_in_installed, Found :: Some ( _, _) )
458452 {
459- if dep. importance == DependencyImportance :: Required {
453+ if dep. required {
460454 fail ! (
461455 "Dependency '{0}' not found in installed mods nor index! \
462456 If this is a mod that hasn't been published yet, install it \
@@ -604,14 +598,7 @@ pub fn check_dependencies(
604598 // know if to link or not)
605599 fs:: write (
606600 dep_dir. join ( & dep. id ) . join ( "geode-dep-options.json" ) ,
607- format ! (
608- r#"{{ "required": {} }}"# ,
609- if dep. importance == DependencyImportance :: Required {
610- "true"
611- } else {
612- "false"
613- }
614- ) ,
601+ format ! ( r#"{{ "required": {} }}"# , dep. required) ,
615602 )
616603 . nice_unwrap ( "Unable to save dep options" ) ;
617604 }
0 commit comments