Update fsPlugin.ts

pull/4401/head
Liana Husikyan 1 year ago committed by GitHub
parent a63020f5ab
commit 0d24909cd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      apps/remix-ide/src/app/plugins/electron/fsPlugin.ts

@ -18,8 +18,6 @@ export class fsPlugin extends ElectronPlugin {
}) })
this.methods = ['readdir', 'readFile', 'writeFile', 'mkdir', 'rmdir', 'unlink', 'rename', 'stat', 'lstat', 'exists', 'setWorkingDir', 'getRecentFolders', 'openWindow'] this.methods = ['readdir', 'readFile', 'writeFile', 'mkdir', 'rmdir', 'unlink', 'rename', 'stat', 'lstat', 'exists', 'setWorkingDir', 'getRecentFolders', 'openWindow']
// List of commands all filesystems are expected to provide. `rm` is not // List of commands all filesystems are expected to provide. `rm` is not
// included since it may not exist and must be handled as a special case // included since it may not exist and must be handled as a special case
const commands = [ const commands = [
@ -36,7 +34,6 @@ export class fsPlugin extends ElectronPlugin {
] ]
this.fs = { this.fs = {
exists: async (path: string) => { exists: async (path: string) => {
path = fixPath(path) path = fixPath(path)
const exists = await this.call('fs', 'exists', path) const exists = await this.call('fs', 'exists', path)
@ -109,29 +106,11 @@ export class fsPlugin extends ElectronPlugin {
path = fixPath(path) path = fixPath(path)
return await this.call('fs', 'symlink', target, path) return await this.call('fs', 'symlink', target, path)
} }
} }
} }
async onActivation() { async onActivation() {
(window as any).remixFileSystem = this.fs (window as any).remixFileSystem = this.fs
this.on('fs', 'workingDirChanged', async (path: string) => { this.on('fs', 'workingDirChanged', async (path: string) => {
workingDir = path workingDir = path
await this.call('fileManager', 'refresh') await this.call('fileManager', 'refresh')
@ -145,5 +124,4 @@ export class fsPlugin extends ElectronPlugin {
} }
}) })
} }
} }
Loading…
Cancel
Save