Commit e0d62d9c authored by Cameron Yule's avatar Cameron Yule

Replacing the manual parsing of the /etc/group file with the equivalent call...

Replacing the manual parsing of the /etc/group file with the equivalent call from the Etc class in the Ruby standard library. This has the benefit of supporting additional platforms (e.g. OS X).
parent 85de55a1
...@@ -77,8 +77,7 @@ namespace :gitlab do ...@@ -77,8 +77,7 @@ namespace :gitlab do
end end
def gid_for(group_name) def gid_for(group_name)
group_line = File.read("/etc/group").lines.select{|l| l.start_with?("#{group_name}:")}.first Etc.getgrnam(group_name).gid
group_line.split(":")[2].to_i
end end
def warn_user_is_not_gitlab def warn_user_is_not_gitlab
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment