bin/cknifewcdir in cknife-1.3.0 vs bin/cknifewcdir in cknife-1.4.1

- old
+ new

@@ -29,10 +29,10 @@ method_option :start, :type => :string, :default => "", :desc => "location to begin your search" method_option :skip, :type => :array, :default => [], :desc => "names of directories to skip" def count(*patterns) start_point = options[:start].empty? ? "." : options[:start].chomp('/') - pattern_s = "\\( " + patterns.map { |p| "-name #{p}" }.join(' -o ') + " \\) " + pattern_s = "\\( " + patterns.map { |p| "-name '#{p}'" }.join(' -or ') + " \\) " skip_s = options[:skip].empty? ? "" : "-type d \\( " + options[:skip].map { |dir| "-path #{start_point}/#{dir.chomp('/')}" }.join(' -o ') + " \\) -prune -o " # note patterns must go after the skips (after the -prune -o) cmd = "find #{start_point} #{skip_s}#{pattern_s} -exec wc -l {} \\;"