mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +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
|
PRODUCTION_PUBLISH_DIR = '/var/www/samhuri.net/public'.freeze
|
||||||
BETA_PUBLISH_DIR = '/var/www/beta.samhuri.net/public'.freeze
|
BETA_PUBLISH_DIR = '/var/www/beta.samhuri.net/public'.freeze
|
||||||
WATCHABLE_DIRECTORIES = %w[public posts lib].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
|
BUILD_TARGETS = %w[debug mudge beta release].freeze
|
||||||
|
|
||||||
# Generate the site in debug mode (localhost:8000)
|
# Generate the site in debug mode (localhost:8000)
|
||||||
|
|
@ -154,12 +155,12 @@ end
|
||||||
|
|
||||||
# Run StandardRB linter
|
# Run StandardRB linter
|
||||||
def lint
|
def lint
|
||||||
exec 'bundle exec standardrb'
|
exec(*standardrb_command)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Auto-fix StandardRB issues
|
# Auto-fix StandardRB issues
|
||||||
def lint_fix
|
def lint_fix
|
||||||
exec 'bundle exec standardrb --fix'
|
exec(*standardrb_command('--fix'))
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
@ -189,6 +190,10 @@ def watch_paths
|
||||||
WATCHABLE_DIRECTORIES.flat_map { |path| ['-r', path] }
|
WATCHABLE_DIRECTORIES.flat_map { |path| ['-r', path] }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def standardrb_command(*extra_args)
|
||||||
|
["bundle", "exec", "standardrb", *extra_args, *LINT_TARGETS]
|
||||||
|
end
|
||||||
|
|
||||||
def run_rsync(local_paths:, publish_dir:, dry_run:, delete:)
|
def run_rsync(local_paths:, publish_dir:, dry_run:, delete:)
|
||||||
command = ['rsync', '-aKv', '-e', 'ssh -4']
|
command = ['rsync', '-aKv', '-e', 'ssh -4']
|
||||||
command << '--dry-run' if dry_run
|
command << '--dry-run' if dry_run
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue