mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-09-19 08:07:22 +03:00
make the whole directory before writing the delta file
This commit is contained in:
parent
0dda0afc90
commit
51e981a54e
@ -241,8 +241,10 @@ pub fn save_current_file_deltas(
|
||||
deltas: &Vec<Delta>,
|
||||
) -> Result<(), std::io::Error> {
|
||||
let project_deltas_path = repo.path().join(butler::dir()).join("session/deltas");
|
||||
std::fs::create_dir_all(&project_deltas_path)?;
|
||||
let delta_path = project_deltas_path.join(file_path);
|
||||
let delta_dir = delta_path.parent().unwrap();
|
||||
std::fs::create_dir_all(&delta_dir)?;
|
||||
log::info!("mkdir {}", delta_path.to_str().unwrap());
|
||||
log::info!("Writing deltas to {}", delta_path.to_str().unwrap());
|
||||
let raw_deltas = serde_json::to_string(&deltas)?;
|
||||
std::fs::write(delta_path, raw_deltas)?;
|
||||
|
Loading…
Reference in New Issue
Block a user