local-wpcli
Version:
A CLI to configure WP-CLI with the websites of Local by Flywheel.
29 lines (24 loc) ⢠566 B
JavaScript
/**
* Check files.
*
* Check if config files already exists &
* show the messages accordingly.
*/
;
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);
}
});
}