Skip to content

Commit

Permalink
Check for existence of 'apps' and 'users' in the configuration file.
Browse files Browse the repository at this point in the history
  • Loading branch information
waratuman committed Oct 25, 2016
1 parent 1c45dd5 commit d13b78b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions sync-accounts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ def read_permissions(url)
end

# Add keys to users and apps
yaml['users'].each do |user|
permissions['users'][user] = github_keys(user)
if (yaml['users'])
yaml['users'].each do |user|
permissions['users'][user] = github_keys(user)
end
end
yaml['apps'].each do |app, users|
permissions['apps'][app] = users.map{|u| github_keys(u) }.flatten

if (yaml['apps'])
yaml['apps'].each do |app, users|
permissions['apps'][app] = users.map{|u| github_keys(u) }.flatten
end
end

permissions
Expand Down

0 comments on commit d13b78b

Please sign in to comment.