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 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 of each of those top level project folders, looking for the Gruntfile.(js|coffee).
Instead of using self.window.folders(), 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?
From testing on Windows 8.1 it appears that its not case-sensitive either, so Gruntfile.js and gruntfile.js both worked for me.
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.js
andgruntfile.js
both worked for me.