UNPKG

local-wpcli

Version:

A CLI to configure WP-CLI with the websites of Local by Flywheel.

29 lines (24 loc) • 566 B
/** * Check files. * * Check if config files already exists & * show the messages accordingly. */ 'use strict'; const chalk = require('chalk'); const files = require('./files'); module.exports = async (config_files) => { config_files.forEach(function (filename) { const file = `${process.cwd()}/${filename}`; if (files.fileExists(file)) { console.error( chalk.red( `āŒ Error: ${filename} already exists! āœ… Use -f or --force to overide the existing files. šŸ‘‰ For more details, check help.` ) ); process.exit(1); } }); }