Skip to content

Commit

Permalink
just to be safe, strip "/"
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgrammerIn-wonderland committed Nov 10, 2024
1 parent 369a4a5 commit 90c6e9b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/api/LocalFS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,9 @@ class LocalFS extends AFSProvider<LocalFSStats> {
// }

const fileName = this.path.basename(path);
const [parentHandle, realParent] = await this.getChildDirHandle(

// eslint-disable-next-line prefer-const
let [parentHandle, realParent] = await this.getChildDirHandle(
this.path.dirname(path),
);
const fileHandleWritable = await (
Expand All @@ -752,6 +754,8 @@ class LocalFS extends AFSProvider<LocalFSStats> {
fileHandleWritable.write(target);
fileHandleWritable.close();

if (realParent.startsWith("/")) realParent = realParent.slice(1);

const fullPath = realParent + "/" + fileName;
const fileStats = this.stats.get(fullPath) || {};
if (fullPath) {
Expand Down

0 comments on commit 90c6e9b

Please sign in to comment.