Merge pull request #20389 from Homebrew/service_cron_null
service: ensure JSON cron output can be `null`.
This commit is contained in:
commit
726f83c4a8
@ -529,9 +529,9 @@ module Homebrew
|
|||||||
|
|
||||||
return { name: name_params }.compact_blank if @run_params.blank?
|
return { name: name_params }.compact_blank if @run_params.blank?
|
||||||
|
|
||||||
cron_string = unless @cron.empty?
|
cron_string = if @cron.present?
|
||||||
[:Minute, :Hour, :Day, :Month, :Weekday]
|
[:Minute, :Hour, :Day, :Month, :Weekday]
|
||||||
.map { |key| @cron[key].to_s }
|
.filter_map { |key| @cron[key].to_s.presence }
|
||||||
.join(" ")
|
.join(" ")
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -555,7 +555,7 @@ module Homebrew
|
|||||||
run: @run_params,
|
run: @run_params,
|
||||||
run_type: @run_type,
|
run_type: @run_type,
|
||||||
interval: @interval,
|
interval: @interval,
|
||||||
cron: cron_string,
|
cron: cron_string.presence,
|
||||||
keep_alive: @keep_alive,
|
keep_alive: @keep_alive,
|
||||||
launch_only_once: @launch_only_once,
|
launch_only_once: @launch_only_once,
|
||||||
require_root: @require_root,
|
require_root: @require_root,
|
||||||
|
@ -227,7 +227,7 @@ module Homebrew
|
|||||||
hash[:log_path] = service.log_path
|
hash[:log_path] = service.log_path
|
||||||
hash[:error_log_path] = service.error_log_path
|
hash[:error_log_path] = service.error_log_path
|
||||||
hash[:interval] = service.interval
|
hash[:interval] = service.interval
|
||||||
hash[:cron] = service.cron
|
hash[:cron] = service.cron.presence
|
||||||
|
|
||||||
hash
|
hash
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user