forked from DebaucheryLibrarian/traxxx
Added utils directory to repository.
This commit is contained in:
parent
86d4e8feb7
commit
cbb4fdc919
|
@ -0,0 +1,24 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const Promise = require('bluebird');
|
||||||
|
const knex = require('../knex');
|
||||||
|
|
||||||
|
async function listSites() {
|
||||||
|
const networks = await knex('networks').orderBy('name');
|
||||||
|
|
||||||
|
await Promise.each(networks, async (network) => {
|
||||||
|
console.log(`* **${network.name}**`);
|
||||||
|
|
||||||
|
const sites = await knex('sites')
|
||||||
|
.where({ network_id: network.id })
|
||||||
|
.orderBy('name');
|
||||||
|
|
||||||
|
if (sites.length === 1 && sites[0].name === network.name) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sites.forEach(site => console.log(` * ${site.name}`));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
listSites();
|
Loading…
Reference in New Issue