43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/hooker/cli.rb', line 43
def ensure_hooks
hook_url = options[:hook_url]
events = options[:events]
if hook_url.nil? || events.nil?
puts 'Please provide --hook_url <url> and --events <comma,separated,events>'
exit 1
end
events = events.split(',')
if events.empty?
puts 'Please provide --events <comma,separated,events>'
exit 1
end
if repo = options[:repo]
ensure_hook(repo, hook_url, events)
else
repos = ::Hooker::Repos.list(options).map(&:full_name).sort
repos.each { |r| ensure_hook(r, hook_url, events) }
end
end
|