aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/path.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/leap_cli/path.rb')
-rw-r--r--lib/leap_cli/path.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/leap_cli/path.rb b/lib/leap_cli/path.rb
index 43f2edc..e7626b5 100644
--- a/lib/leap_cli/path.rb
+++ b/lib/leap_cli/path.rb
@@ -87,13 +87,14 @@ module LeapCli; module Path
# tries to find a file somewhere
#
def self.find_file(arg)
- file_path = named_path(arg, Path.provider)
- return file_path if File.exists?(file_path)
-
- file_path = named_path(arg, Path.provider_base)
- return file_path if File.exists?(file_path)
-
- # give up
+ [Path.provider, Path.provider_base].each do |base|
+ file_path = named_path(arg, base)
+ return file_path if File.exists?(file_path)
+ if arg.is_a? String
+ file_path = base + '/files/' + arg
+ return file_path if File.exists?(file_path)
+ end
+ end
return nil
end