16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/train/platforms/detect/uuid.rb', line 16
def find_or_create_uuid
if defined?(@backend.unique_identifier)
uuid_from_string(@backend.unique_identifier)
elsif @platform.unix?
unix_uuid
elsif @platform.windows?
windows_uuid
else
if @platform[:uuid_command]
result = @backend.run_command(@platform[:uuid_command])
return uuid_from_string(result.stdout.chomp) if result.exit_status.zero? && !result.stdout.empty?
end
raise 'Could not find platform uuid! Please set a uuid_command for your platform.'
end
end
|