FredrikNoren / ungit

The easiest way to use git. On any platform. Anywhere.
MIT License
10.45k stars 640 forks source link

Fix plugin loading in electron #1375

Closed campersau closed 4 years ago

campersau commented 4 years ago

I made a mistake in https://github.com/FredrikNoren/ungit/pull/1350 which prevented ungit from beeing loaded in electron. I assumend that fs.readdir(..., { withFileTypes: true }) would just work in electron but since we are using asar it apparently does not. See https://github.com/electron/electron/issues/19074

First commit refactors the code to the fs.readdir and fs.stat equivalent. The second commit gets rid of the directory check completely because we already catch and ignore all errors 😄