Commit cc9e31f4 authored by lyxell's avatar lyxell Committed by GitHub

Merge pull request #833 from jam7/refactor/crew-search

Change crew to check internal hash table instead of directory
parents d2e2593c b6ef8912
......@@ -127,8 +127,8 @@ end
def print_package(pkgName, extra = false)
search pkgName, true
Find.find(CREW_CONFIG_PATH + 'meta/') do |packageList|
print '(i) '.lightgreen if packageList == CREW_CONFIG_PATH + 'meta/' + pkgName + '.filelist'
print '(i) '.lightgreen if @device[:installed_packages].any? do |elem|
elem[:name] == pkgName
end
print @pkg.name
print ": #{@pkg.description}" if @pkg.description
......@@ -163,7 +163,7 @@ def search (pkgName, silent = false)
end
def regexp_search(pkgName)
results = Dir["#{CREW_LIB_PATH}packages/*.rb"] \
results = Dir["#{CREW_LIB_PATH}packages/*.rb"].sort \
.select { |f| File.basename(f, '.rb') =~ Regexp.new(pkgName, true) } \
.collect { |f| File.basename(f, '.rb') } \
.each { |f| print_package(f, ARGV[2] == "extra") }
......
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