api: set specinfra product_version + file_version to nil

whenever the label is empty (typically on all *nix systems) set it to nil instead of ""

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
Dominik Richter 2015-09-15 11:06:33 +02:00
parent 55bd535599
commit 526518fabd

View file

@ -265,11 +265,17 @@ module Vulcano::Backends
end
def product_version
Specinfra::Runner.run_command("(Get-Command '#{@path}').FileVersionInfo.ProductVersion").stdout.strip
res = Specinfra::Runner.
run_command("(Get-Command '#{@path}').FileVersionInfo.ProductVersion").
stdout.strip
res.empty? ? nil : res
end
def file_version
Specinfra::Runner.run_command("(Get-Command '#{@path}').FileVersionInfo.FileVersion").stdout.strip
res = Specinfra::Runner.
run_command("(Get-Command '#{@path}').FileVersionInfo.FileVersion").
stdout.strip
res.empty? ? nil : res
end
end
end