This repository was archived by the owner on Nov 26, 2018. It is now read-only.
Rewrote a chunk of list_gruntfiles() - fixes #77#94
Open
rtpHarry wants to merge 1 commit into
Open
Conversation
This is the first piece of Python I've written today after getting stumped by the issue and seeing others had been affected. The original def just asked for self.window.folders() which isn't a recursive list of the folders in the project. This code replaces the shallow search with a recursive folder search for the `Gruntfile.(js|coffee)` Instead, my code fires off a search of the file system using `os.walk`. I'm concerned that I might have done something bad as I know hitting the file system could be slow in large projects although I don't see any way around it. If any Python experts have a better idea please tweak it. I'm not sure if this information can be cached either.
Author
|
Another note, I'm running Sublime 2 v2.0.2, Build 2221 on Windows 8.1. I haven't tested on any other versions / operating systems. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the first piece of Python I've ever written today. After getting stumped by what path to set up and seeing others had been affected I ended up solving it I think.
The original
list_gruntfiles()just asked forself.window.folders()which isn't a recursive list of the folders in the project. This code replaces the shallow search with a recursive folder search of each of those top level project folders, looking for theGruntfile.(js|coffee).Instead of using
self.window.folders(), my code fires off a search of the file system usingos.walk. I'm concerned that I might have done something bad as I know hitting the file system could be slow in large projects although I don't see any way around it. If any Python experts have a better idea please tweak it. I'm not sure if this information can be cached either?From testing on Windows 8.1 it appears that its not case-sensitive either, so
Gruntfile.jsandgruntfile.jsboth worked for me.