Skip to content

Commit

Permalink
fix(core/web): Filesystem.appendFile creating wrong parent folder (#2985
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jase88 authored May 27, 2020
1 parent 9475129 commit 3951f6b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/web/filesystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ export class FilesystemPluginWeb extends WebPlugin implements FilesystemPlugin {

let parentEntry = await this.dbRequest('get', [parentPath]) as EntryObj;
if (parentEntry === undefined) {
const parentArgPath = parentPath.substr(parentPath.indexOf('/', 1));
const parentArgPathIndex = parentPath.indexOf('/', 1);
const parentArgPath = parentArgPathIndex !== -1 ? parentPath.substr(parentArgPathIndex) : '/';
await this.mkdir({path: parentArgPath, directory: options.directory, recursive: true});
}

Expand Down

0 comments on commit 3951f6b

Please sign in to comment.