diff --git a/bin/project b/bin/project index 4a23a8f..14cb21b 100755 --- a/bin/project +++ b/bin/project @@ -26,6 +26,8 @@ module Bin pre do |global_options, _command, _options, _args| GitHub::Progress.enabled = global_options['quiet'] ? false : true + GitHub::Data.check_dups! + if global_options['vcr-cassette-name'] require 'webmock' WebMock.enable! diff --git a/lib/github/data.rb b/lib/github/data.rb index 794eca2..a6ac322 100644 --- a/lib/github/data.rb +++ b/lib/github/data.rb @@ -46,6 +46,14 @@ def students @students ||= load_list(STUDENTS) end + def check_dups! + %i[members contractors students external_users].combination(2).each do |l, r| + send(l).intersection(send(r)).each do |user| + warn "WARNING: #{user} is found in both #{l} and #{r}" + end + end + end + def bots @bots ||= load_list(BOTS) end