Skip to content

Commit

Permalink
fix(FilePicker): path can now start with a dot
Browse files Browse the repository at this point in the history
  • Loading branch information
TungstnBallon committed Apr 15, 2024
1 parent b964a29 commit 2296b1b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/execution/src/lib/types/io-types/filesystem-inmemory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ export class InMemoryFileSystem implements FileSystem {
}

private processPath(path: string): string[] | null {
if (!path.startsWith(InMemoryFileSystem.getPathSeparator())) {
const [head, ...tail] = path.split(InMemoryFileSystem.getPathSeparator());
if (!(head === '' || head === InMemoryFileSystem.CURRENT_DIR)) {
return null;
}
const parts = path
.split(InMemoryFileSystem.getPathSeparator())
.filter((p) => p !== ''); // Process paths like "folder1//folder1" to "folder1/folder2"

const parts = tail.filter((p) => p !== ''); // Process paths like "folder1//folder1" to "folder1/folder2"
const processedParts: string[] = [];
for (const part of parts) {
if (part === InMemoryFileSystem.CURRENT_DIR) {
Expand Down

0 comments on commit 2296b1b

Please sign in to comment.