Skip to content

Commit

Permalink
Check for existence of 'apps' and 'users' in the configuration file. (#5
Browse files Browse the repository at this point in the history
)

* Check for existence of 'apps' and 'users' in the configuration file.

Fixes #4

* Style changes for #5 (review)
  • Loading branch information
waratuman authored and malomalo committed Jan 5, 2018
1 parent 1c45dd5 commit f7b0598
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 f7b0598

Please sign in to comment.