Skip to content
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

Add exclude filenames. #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions SublimeOnSaveBuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ def on_post_save(self, view):
# Load filename filter. Again, a project level setting takes precedence.
filename_filter = view.settings().get('filename_filter', global_settings.get('filename_filter', '.*'))

exclude_names = view.settings().get('exclude', global_settings.get('exclude', []))

if not should_build:
return

if not re.search(filename_filter, view.file_name()):
return

if view.file_name() in exclude_names:
return

view.window().run_command('build')