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) ...@@ -171,9 +171,11 @@ def help (pkgName)
end end
def files (pkgName) def files (pkgName)
system "cat #{CREW_PREFIX}/etc/crew/meta/#{pkgName}.filelist" filelist = "#{CREW_PREFIX}/etc/crew/meta/#{pkgName}.filelist"
print "Total found: ".lightgreen abort "Package #{pkgName} is not installed.".lightred unless File.exists? #{filelist}
system "wc -l #{CREW_PREFIX}/etc/crew/meta/#{pkgName}.filelist | cut -d' ' -f1" system "cat #{filelist}"
lines = `wc -l "#{filelist}"`.strip.split(' ')[0].to_i
puts "Total found: #{lines}".lightgreen
end end
def whatprovides (pkgName) 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