Delete profiles before overwriting
This commit is contained in:
		
							parent
							
								
									30ee8c06f7
								
							
						
					
					
						commit
						132d494cc2
					
				| 
						 | 
					@ -65,6 +65,7 @@ impl ProfileWindow {
 | 
				
			||||||
            .save_file();
 | 
					            .save_file();
 | 
				
			||||||
        if let Some(path) = file {
 | 
					        if let Some(path) = file {
 | 
				
			||||||
            let bytes = pollster::block_on(bytes_receiver)?;
 | 
					            let bytes = pollster::block_on(bytes_receiver)?;
 | 
				
			||||||
 | 
					            let _ = fs::remove_file(&path);
 | 
				
			||||||
            fs::write(&path, bytes)?;
 | 
					            fs::write(&path, bytes)?;
 | 
				
			||||||
            Ok(Some(path.display().to_string()))
 | 
					            Ok(Some(path.display().to_string()))
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue