-
Notifications
You must be signed in to change notification settings - Fork 60
fix: don't show "start a build" if the file is in node_modules #472
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
Conversation
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.
Awesome.
Thanks for the super quick fix.
server/src/server.ts
Outdated
@@ -188,7 +189,7 @@ let openedFile = (fileUri: string, fileContent: string) => { | |||
openFiles: new Set(), | |||
filesWithDiagnostics: new Set(), | |||
bsbWatcherByEditor: null, | |||
hasPromptedToStartBuild: false, | |||
hasPromptedToStartBuild: projectRootPath.includes("node_modules") ? "never" : false, |
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.
Is this just string search?
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.
Yes.
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.
Any risk one puts the file in this_is_not_node_modules_carrots
or is that too pedantic?
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.
One could make it includes("/node_modules/")
and we should be as safe as we can be.
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.
@zth but it will fail on windows
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.
Right. But looks like you accounted for that in your fix.
This is great. Merged. |
Closes #471