Skip to content

Commit 99ab8cc

Browse files
committed
Improve handling of missing output of virtualenv version fact command
Partially fixes #527 Signed-off-by: Wiebe Verweij <[email protected]>
1 parent ce29405 commit 99ab8cc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/facter/virtualenv_version.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
Facter.add('virtualenv_version') do
44
setcode do
55
if Facter::Util::Resolution.which('virtualenv')
6-
Facter::Util::Resolution.exec('virtualenv --version 2>&1').match(%r{(\d+\.\d+\.?\d*).*$})[1]
6+
results = Facter::Util::Resolution.exec('virtualenv --version 2>&1').match(%r{(\d+\.\d+\.?\d*).*$})
7+
results[1] if results
78
end
89
end
910
end

0 commit comments

Comments
 (0)