Cleans temp files produced during Pdf generation

main
Paul Schneider 9 years ago
parent 3c23cf0286
commit adbaa961b0
1 changed files with 3 additions and 0 deletions

@ -132,6 +132,7 @@ namespace Yavsc.Helpers
p.StartInfo.WorkingDirectory = tempdir; p.StartInfo.WorkingDirectory = tempdir;
p.StartInfo = new ProcessStartInfo(); p.StartInfo = new ProcessStartInfo();
p.StartInfo.UseShellExecute = false; p.StartInfo.UseShellExecute = false;
p.StartInfo.WorkingDirectory = tempdir;
p.StartInfo.FileName = "/usr/bin/texi2pdf"; p.StartInfo.FileName = "/usr/bin/texi2pdf";
p.StartInfo.Arguments = $"--batch --build-dir=. -o {fo.FullName} {fi.FullName}"; p.StartInfo.Arguments = $"--batch --build-dir=. -o {fo.FullName} {fi.FullName}";
p.Start(); p.Start();
@ -142,6 +143,8 @@ namespace Yavsc.Helpers
} }
} }
fi.Delete(); fi.Delete();
var di = new DirectoryInfo(Path.Combine(tempdir,$"{Model.BaseFileName}.t2d"));
di.Delete(true);
} }
Model.Generated = fo.Exists; Model.Generated = fo.Exists;
Model.GenerationErrorMessage = new HtmlString(errorMsg); Model.GenerationErrorMessage = new HtmlString(errorMsg);

Loading…