MaxMelcher / AzureDevOps.WikiPDFExport

Export Azure DevOps Wiki to PDF
MIT License
186 stars 62 forks source link

Tool leaves `.localchromium` folders in root of run #121

Closed Zhaph closed 1 year ago

Zhaph commented 1 year ago

When you run the azuredevops-export-wiki it leaves a .localchromium folder in the current path of the command line.

I've added the executable to my path so that it's accessible to a number of project wikis, so I'm being left with multiple copies of the headless chromium browser.

The docs for --chrome-path state:

Path of the chrome or chromium executable. It'll be used if mermaid diagrams support is turned on (-m/--mermaid). If not specified, a headless version will be downloaded.

I'm not generally specifying -m but looking at the code for the PdfGenerator class that switch isn't part of the check when downloading these libraries.

Seeing as Puppeteer is storing this by default in the current directory, rather than actually determining where the binaries are located, could you either:

  1. Pass a [BrowserFetcherOptions](https://www.puppeteersharp.com/api/PuppeteerSharp.BrowserFetcherOptions.html) object into the BrowserFetcher with Path set to the assembly root.
  2. Pass a BrowserFetcherOptions object into the BrowserFetcher with Path set to Path.Join(Path.GetTempPath(), "AzureDevOpsExportWiki") or similar

Also recommend updating the documentation on the ChromePath option to remove the reference to mermaid as this is used in all cases.