nicosantangelo / sublime-gulp

Run Gulp tasks and use snippets from Sublime Text
https://sublime-gulp.nicosantangelo.com/
MIT License
155 stars 18 forks source link

Use "ignored_gulpfile_folders even" on root folders too #82

Closed Ivanca closed 6 years ago

nicosantangelo commented 7 years ago

Thanks a lot for this! (and for waiting, I was away traveling last week)

I'll test and release this today!

nicosantangelo commented 7 years ago

I've been thinking about this for a bit and while the code works! I think I would rather skip the folder entirely instead of waiting until it was walked, so instead of adding the code in append_to_gulp_files, in append_paths we could do:

    def append_paths(self):
        gulpfile_paths = self.settings.get("gulpfile_paths", [])
        ignored_gulpfile_folders = self.settings.get("ignored_gulpfile_folders", [])

        searcheable_folders = [folder_path for folder_path in self.sercheable_folders if os.path.basename(os.path.normpath(folder_path)) not in ignored_gulpfile_folders]
        # ...

And use that new variable later on instead of self.sercheable_folders. What do you think?

PD: O god...I've just noticed the typo on sercheable_folders, gives away that I'm not a native speaker 😛

Ivanca commented 7 years ago

Sure thing (you know better how to implement it)