File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed
Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ impl Default for Settings {
5252}
5353
5454pub fn load_up_checks ( data_dir_path : PathBuf ) -> Result < ( ) , Error > {
55+ create_dir_all ( & data_dir_path)
56+ . map_err ( |err : IoError | Error :: directory ( "create" , & data_dir_path, err) ) ?;
5557 save_file (
5658 & data_dir_path. join ( "settings.json" ) ,
5759 to_value ( Settings :: default ( ) ) ?,
Original file line number Diff line number Diff line change @@ -25,8 +25,11 @@ pub enum Error {
2525}
2626
2727impl Error {
28- pub fn directory ( action : & str , path : & str , err : IoError ) -> Self {
29- Self :: DirectoryOperation ( format ! ( "Failed to {action} the directory {path}: {err}" ) )
28+ pub fn directory ( action : & str , path : impl AsRef < Path > , err : IoError ) -> Self {
29+ Self :: DirectoryOperation ( format ! (
30+ "Failed to {action} the directory {}: {err}" ,
31+ path. as_ref( ) . to_string_lossy( ) . to_string( )
32+ ) )
3033 }
3134 pub fn file ( action : & str , path : impl AsRef < Path > , err : IoError ) -> Self {
3235 Self :: FileOperation ( format ! (
Original file line number Diff line number Diff line change @@ -130,12 +130,10 @@ export const startUp = async () => {
130130 setter ( data ) ;
131131 } )
132132 ) ;
133- ( async ( ) => {
134- const response = await getModules ( ) ;
135- useModulesStore
136- . getState ( )
137- . setModules ( response . map ( ( module ) => ( { ...module , selected : true } ) ) ) ;
138- } ) ( ) ;
133+ const response = await getModules ( ) ;
134+ useModulesStore
135+ . getState ( )
136+ . setModules ( response . map ( ( module ) => ( { ...module , selected : true } ) ) ) ;
139137 if ( ! useSettingsStore . getState ( ) . settings . download_path )
140138 toggleModal ( "browse-modal" , true ) ;
141139 const storeConfigs = [
You can’t perform that action at this time.
0 commit comments