diff --git a/scripts/commands/status/update.js b/scripts/commands/status/update.js deleted file mode 100644 index b7db23d5..00000000 --- a/scripts/commands/status/update.js +++ /dev/null @@ -1,52 +0,0 @@ -const { file, markdown, logger, table } = require('../../core') -const { program } = require('commander') -const _ = require('lodash') - -const CONFIGS_PATH = process.env.CONFIGS_PATH || 'sites/**/*.config.js' - -const options = program - .option('-c, --config ', 'Set path to config file', '.readme/status.json') - .parse(process.argv) - .opts() - -async function main() { - let data = [] - - const files = await file.list(CONFIGS_PATH).catch(console.error) - for (const filepath of files) { - try { - const { site, skip } = require(file.resolve(filepath)) - - if (skip) continue - - data.push([ - site, - `${site}` - ]) - } catch (err) { - console.error(err) - continue - } - } - - data = Object.values(_.groupBy(data, item => item[0])) - - const output = table.create(data, [ - 'Site', - 'Status                                                   ' - ]) - - await file.create('./.readme/_sites.md', output) - - await updateMarkdown() -} - -main() - -async function updateMarkdown() { - logger.info('updating status.md...') - - const config = require(file.resolve(options.config)) - await file.createDir(file.dirname(config.build)) - await markdown.compile(options.config) -}