askUserPermission for the resolveAndSave

pull/5370/head
yann300 3 years ago
parent 0781ec7423
commit 68f3fbd60a
  1. 4
      libs/remix-core-plugin/src/lib/compiler-content-imports.ts

@ -124,6 +124,10 @@ export class CompilerImports extends Plugin {
*/
async resolveAndSave (url, targetPath) {
try {
if (targetPath && this.currentRequest) {
const canCall = await this.askUserPermission('writeFile', 'This action will update the path ' + targetPath)
if (!canCall) throw new Error('No permission to update ' + targetPath)
}
const provider = await this.call('fileManager', 'getProviderOf', url)
if (provider) {
if (provider.type === 'localhost' && !provider.isConnected()) {

Loading…
Cancel
Save