From b310c2f150a4802d63d492cfe3dfae650ebbc41e Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Wed, 9 Nov 2016 09:43:07 +0000 Subject: Raise ENOENT if btrfs cannot be found --- lib/byteback/util.rb | 7 ++++--- 1 file 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 -- cgit v1.2.1