summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2016-11-09 09:43:07 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2016-11-09 09:43:07 +0000
commitb310c2f150a4802d63d492cfe3dfae650ebbc41e (patch)
tree37c978222c6a976fb70143cc00239696923aaf10 /lib
parent3cc8a83938cd4eae9a196375dca2fd9127f23aa0 (diff)
Raise ENOENT if btrfs cannot be found
Diffstat (limited to 'lib')
-rw-r--r--lib/byteback/util.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/byteback/util.rb b/lib/byteback/util.rb
index 07d7056..ebf5ca5 100644
--- a/lib/byteback/util.rb
+++ b/lib/byteback/util.rb
@@ -68,9 +68,10 @@ module Byteback
end
def btrfs_bin
- path = '/bin/btrfs'
- path = '/sbin/btrfs' unless File.exists?(path)
- path
+ %w(/bin/btrfs /sbin/btrfs).each do |path|
+ return path if File.exist?(path)
+ end
+ raise Errno::ENOENT, 'btrfs'
end
end