Commit 4897e3c0 authored by Ed Reel's avatar Ed Reel

Count lines and abort if filelist not found

parent e38345e2
......@@ -171,9 +171,11 @@ def help (pkgName)
end
def files (pkgName)
system "cat #{CREW_PREFIX}/etc/crew/meta/#{pkgName}.filelist"
print "Total found: ".lightgreen
system "wc -l #{CREW_PREFIX}/etc/crew/meta/#{pkgName}.filelist | cut -d' ' -f1"
filelist = "#{CREW_PREFIX}/etc/crew/meta/#{pkgName}.filelist"
abort "Package #{pkgName} is not installed.".lightred unless File.exists? #{filelist}
system "cat #{filelist}"
lines = `wc -l "#{filelist}"`.strip.split(' ')[0].to_i
puts "Total found: #{lines}".lightgreen
end
def whatprovides (pkgName)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment