Skip to content

Commit

Permalink
fix(electron): Filesystem.rmdir not using directory (#1623)
Browse files Browse the repository at this point in the history
* Update to use directory and lookupPath
  • Loading branch information
Chris Lloyd authored and jcesarmobile committed Jun 5, 2019
1 parent 6625d5e commit 7549ccc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions electron/src/electron/filesystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,12 @@ export class FilesystemPluginElectron extends WebPlugin implements FilesystemPlu
});
}

// TODO: continue bring to spec.
rmdir(options: RmdirOptions): Promise<RmdirResult> {
return new Promise((resolve, reject) => {
this.NodeFS.rmdir(options.path, (err:any) => {
if(Object.keys(this.fileLocations).indexOf(options.directory) === -1)
reject(`${options.directory} is currently not supported in the Electron implementation.`);
let lookupPath = this.fileLocations[options.directory] + options.path;
this.NodeFS.rmdir(lookupPath, (err:any) => {
if(err) {
reject(err);
return;
Expand Down

0 comments on commit 7549ccc

Please sign in to comment.