summaryrefslogtreecommitdiff
path: root/lib/leap_cli/util.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2012-11-27 01:40:01 -0800
committerelijah <elijah@riseup.net>2012-11-27 01:40:01 -0800
commitb5bf2fe3874f9ce97b36dc37b17ce66270260f03 (patch)
tree7af8ccce2a3862545f04d91a60fcd8f3104e1342 /lib/leap_cli/util.rb
parent051675c61937f184c555bac3af07be182f0c6acd (diff)
improved logging all around.
Diffstat (limited to 'lib/leap_cli/util.rb')
-rw-r--r--lib/leap_cli/util.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/leap_cli/util.rb b/lib/leap_cli/util.rb
index c3adbdc..967acca 100644
--- a/lib/leap_cli/util.rb
+++ b/lib/leap_cli/util.rb
@@ -4,7 +4,6 @@ require 'fileutils'
require 'erb'
module LeapCli
-
module Util
extend self
@@ -54,9 +53,13 @@ module LeapCli
#
# assert that the command is available
#
- def assert_bin!(cmd_name)
+ def assert_bin!(cmd_name, msg=nil)
assert! `which #{cmd_name}`.strip.any? do
- log :missing, "command '%s'" % cmd_name
+ log :missing, "command '%s'" % cmd_name do
+ if msg
+ log msg
+ end
+ end
end
end