Skip to content

Commit

Permalink
Fix migrator (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kruemmelspalter authored Feb 2, 2024
1 parent 0abf02e commit b1f1e0d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src-tauri/src/bin/migrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@ async fn main() -> Result<()> {
.await?;

let docdir = filespider::document::get_document_directory(&id)?;
let old_id = r.get::<Uuid, &str>("id");
let old_id = Uuid::try_parse(&r.get::<String, &str>("id"))?;
let ext = match r.get::<Option<String>, &str>("fileExtension") {
Some(s) => format!(".{}", s),
None => String::new(),
};
if !Command::new("sh")
.arg("-c")
.arg(format!(
"cp -r {}/{}/* {} && mv {}/{} {}/{}",
args.document_directory, old_id, docdir, docdir, old_id, docdir, id
"mkdir {}/{}; cp -r {}/{}/* {} && mv {}/{}{} {}/{}{}",
docdir, id, args.document_directory, old_id, docdir, docdir, old_id, ext, docdir, id, ext,
))
.spawn()?
.wait()
Expand Down

0 comments on commit b1f1e0d

Please sign in to comment.