joelspadin-garmin / vscode-private-extension-manager

Private extension manager for Visual Studio Code
102 stars 22 forks source link

Does not cope with pacote.extract failures #33

Open jamesbattersby opened 3 years ago

jamesbattersby commented 3 years ago

There is no check around pacote.extract in Registory.ts.

// If we've already downloaded this package, just return it.
if (!fs.existsSync(dest)) {
      await pacote.extract(spec, dest, this.options);
}

The problem is that if pacote fails for some reason (apart from the user not knowing), the destination directory may be created which will prevent us from trying again.

I encountered this issue when the registry I was using redirected me to a mirror that wanted me to login. In this case there was an exception thrown. It would be good to report the error, and clean up the download directory in the error case.

joelspadin-garmin commented 3 years ago

Thanks for the report. I may not have time to get to this for a while, but it looks like it shouldn't be too hard to fix.