Commit cb8dd37d authored by Leo Iannacone's avatar Leo Iannacone

use glob to get distributions easly

parent 83943f6e
fs = require("fs") fs = require("fs")
glob = require("glob")
config = require("./config") config = require("./config")
utils = require("./utils") utils = require("./utils")
Tail = utils.Tail Tail = utils.Tail
e = config.events.broadcast e = config.events.broadcast
_get_distributions = (callback) -> _get_distributions = (callback) ->
utils.get_files_list config.debomatic.path, true, (directories) -> glob "#{config.debomatic.path}/*/pool", {}, (err, directories) ->
distributions = [] distributions = []
for dir in directories for dir in directories
data = {} name = dir.split('/')[-2..][0]
data.distribution = {} distributions.push name
data.distribution.name = dir
pool_path = utils.get_distribution_pool_path(data)
distributions.push dir if fs.existsSync(pool_path)
callback(distributions) callback(distributions)
......
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