mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
Use fixed allowlist for Bake lint targets
This commit is contained in:
parent
878248cef5
commit
fb07e8abba
1 changed files with 7 additions and 2 deletions
9
bake.rb
9
bake.rb
|
|
@ -8,6 +8,7 @@ PUBLISH_HOST = 'mudge'.freeze
|
|||
PRODUCTION_PUBLISH_DIR = '/var/www/samhuri.net/public'.freeze
|
||||
BETA_PUBLISH_DIR = '/var/www/beta.samhuri.net/public'.freeze
|
||||
WATCHABLE_DIRECTORIES = %w[public posts lib].freeze
|
||||
LINT_TARGETS = %w[bake.rb bin Gemfile lib spec].freeze
|
||||
BUILD_TARGETS = %w[debug mudge beta release].freeze
|
||||
|
||||
# Generate the site in debug mode (localhost:8000)
|
||||
|
|
@ -154,12 +155,12 @@ end
|
|||
|
||||
# Run StandardRB linter
|
||||
def lint
|
||||
exec 'bundle exec standardrb'
|
||||
exec(*standardrb_command)
|
||||
end
|
||||
|
||||
# Auto-fix StandardRB issues
|
||||
def lint_fix
|
||||
exec 'bundle exec standardrb --fix'
|
||||
exec(*standardrb_command('--fix'))
|
||||
end
|
||||
|
||||
private
|
||||
|
|
@ -189,6 +190,10 @@ def watch_paths
|
|||
WATCHABLE_DIRECTORIES.flat_map { |path| ['-r', path] }
|
||||
end
|
||||
|
||||
def standardrb_command(*extra_args)
|
||||
["bundle", "exec", "standardrb", *extra_args, *LINT_TARGETS]
|
||||
end
|
||||
|
||||
def run_rsync(local_paths:, publish_dir:, dry_run:, delete:)
|
||||
command = ['rsync', '-aKv', '-e', 'ssh -4']
|
||||
command << '--dry-run' if dry_run
|
||||
|
|
|
|||
Loading…
Reference in a new issue