bin/whereto in where_to-1.0.6 vs bin/whereto in where_to-1.0.7
- old
+ new
@@ -63,12 +63,18 @@
puts ''
location = Helpers::check_location!(args.first)
@options = options
- Dir.chdir location
- files = Dir.glob "*#{options[:ext]}"
- raise WhereTo::NoFilesError.new(options[:ext], location) if files.none?
+ files = if File.directory?(location)
+ Dir.chdir location
+ files = Dir.glob "*#{options[:ext]}"
+ raise WhereTo::NoFilesError.new(options[:ext], location) if files.none?
+ files
+ else
+ Array(location)
+ end
+
puts "I found the following files:"
puts files
puts ""
WhereTo.configure do |config|