mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-18 08:53:33 +00:00
Scripts: a renamed file's old path is named in the report's written
rename named only the new path in written, so a run that renamed a file an earlier run wrote did not name the path it emptied. It now names both, as remove names the path it deletes.
This commit is contained in:
@@ -1763,6 +1763,8 @@ fn rename(host: &Host, a: &[Data]) -> Result<Data, HostError> {
|
||||
file.target = Some(if rest.as_os_str().is_empty() { to.clone() } else { to.join(rest) });
|
||||
}
|
||||
}
|
||||
// The old path no longer holds the file, so the report names it as well as the new one.
|
||||
disk.wrote(&from);
|
||||
disk.wrote(&to);
|
||||
Ok(Data::Object(vec![("fs".into(), Data::String(new))]))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user