Westwind.HtmlPackager icon indicating copy to clipboard operation
Westwind.HtmlPackager copied to clipboard

MAJOR: Deletes files in folder

Open nitrocalcite opened this issue 5 years ago • 1 comments

Apparently, this tool will delete all files in the directory without warning or prompting that share the name of the file you attempted to process under a certain error condition.

I've been attempting to use the prepackaged exe version.
I'm getting this error:

Unhandled Exception: System.UnauthorizedAccessException: Access to the path '$the_path\HtmlPackager.exe' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalDelete(String path, Boolean checkHost)
   at System.IO.File.Delete(String path)
   at Westwind.HtmlPackager.HtmlPackager.PackageHtmlToFolder(String urlOrFile, String outputFile, String basePath, Boolean deleteFolderContents)
   at HtmlPackager.HtmlPackagerProcessor.Process()
   at HtmlPackager.Program.Main(String[] args)

When this error (but not others) occurs, files get deleted. So, attempting to process name.html will delete name.bib and name.adoc and name.html and so on and so forth!

I have no idea why this would be. I lost work, but thankfully I had backups.

Use with extreme caution.

nitrocalcite avatar Apr 30 '20 02:04 nitrocalcite

Update: Identical behavior observed with v0.1.2's executable as well. For those who stumble upon this looking for an alternative, this Python solution worked for me.

nitrocalcite avatar Apr 30 '20 02:04 nitrocalcite