Commit efe90876062b3ca0f645baa7091d865c759c4da2

Authored by Axilleas Pipinellis
1 parent a45e4721

Added os_name support for systems running systemd.

Showing 1 changed file with 4 additions and 1 deletions   Show diff stats
lib/tasks/gitlab/task_helpers.rake
... ... @@ -16,7 +16,7 @@ namespace :gitlab do
16 16 # Check which OS is running
17 17 #
18 18 # It will primarily use lsb_relase to determine the OS.
19   - # It has fallbacks to Debian, SuSE and OS X.
  19 + # It has fallbacks to Debian, SuSE, OS X and systems running systemd.
20 20 def os_name
21 21 os_name = run("lsb_release -irs")
22 22 os_name ||= if File.readable?('/etc/system-release')
... ... @@ -32,6 +32,9 @@ namespace :gitlab do
32 32 os_name ||= if os_x_version = run("sw_vers -productVersion")
33 33 "Mac OS X #{os_x_version}"
34 34 end
  35 + os_name ||= if File.readable?('/etc/os-release')
  36 + File.read('/etc/os-release').match(/PRETTY_NAME=\"(.+)\"/)[1]
  37 + end
35 38 os_name.try(:squish!)
36 39 end
37 40  
... ...