Permalink
Browse files

Return a boolean from package_installed?

  • Loading branch information...
1 parent c2ea2b8 commit 954dd33aeb6ef4d680ca50b891a6132e9db03773 @cespare cespare committed Oct 11, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/terraform/dsl.rb
@@ -45,7 +45,7 @@ def satisfy_dependencies
# These are very common tasks which are needed by almost everyone, and so they're bundled with this DSL.
#
- def package_installed?(package) `dpkg -s #{package} 2> /dev/null | grep Status`.match(/\sinstalled/) end
+ def package_installed?(package) !!`dpkg -s #{package} 2> /dev/null | grep Status`.match(/\sinstalled/) end
def install_package(package)
# Specify a noninteractive frontend, so dpkg won't prompt you for info. -q is quiet; -y is "answer yes".
shell "sudo DEBIAN_FRONTEND=noninteractive apt-get install -qy #{package}"

0 comments on commit 954dd33

Please sign in to comment.