-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(server): support import paths with special chars #14856
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,7 +214,7 @@ export class StorageRepository implements IStorageRepository { | |
} | ||
|
||
private asGlob(pathToCrawl: string): string { | ||
const escapedPath = escapePath(pathToCrawl); | ||
const escapedPath = escapePath(pathToCrawl).replaceAll('"', '["]').replaceAll("'", "[']").replaceAll('`', '[`]'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's so freaking annoying that there isn't just a library There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We uncover all kinds of bugs in libraries, I should probably file this as an issue with fast-glob. Likely we are the first ones to even notice |
||
const extensions = `*{${mimeTypes.getSupportedFileExtensions().join(',')}}`; | ||
return `${escapedPath}/**/${extensions}`; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is there a square bracket?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Around the special characters? Turns out, that's how you escape double quotes, single quotes and asterisks when using a dynamic glob pattern. A literal " is written as ["]