cfn-forge
Version:
CloudFormation deployment automation tool with git-based workflows
66 lines (56 loc) • 1.8 kB
JavaScript
/**
* Welcome Screen for CFN-Forge
*
* Simple welcome display when cfn-forge is run without commands
*/
const chalk = require('chalk');
const fs = require('fs');
/**
* Display stylized welcome banner
*/
function displayWelcomeBanner() {
console.log(chalk.gold(`
_____ _____ _ _ _____
/ ____| ___| \\ | | | ___|
| | | |_ | \\| |_____| |_ ___ _ __ __ _ ___
| | | _| | . \` |_____| _/ _ \\| '__/ _\` |/ _ \\
| |____| | | |\\ | | || (_) | | | (_| | __/
\\_____|_| |_| \\_| |_| \\___/|_| \\__, |\\___|
/ |
|___/
`));
console.log(chalk.white(`v${require('../../../package.json').version} - CloudFormation Deployment Automation\n`));
}
/**
* Display contextual help based on current directory
*/
function displayContextualHelp() {
const inProject = fs.existsSync('.cfn-forge.yaml');
if (inProject) {
console.log(chalk.greenBright('CFN-Forge project detected\n'));
console.log(chalk.yellow('Commands:'));
console.log(chalk.white(' cfn-forge deploy'));
console.log(chalk.white(' cfn-forge watch'));
console.log(chalk.white(' cfn-forge cost'));
console.log(chalk.white(' cfn-forge parameters'));
} else {
console.log(chalk.yellow('Quick Start:'));
console.log(chalk.white(' cfn-forge init'));
console.log(chalk.white(' cfn-forge deploy'));
}
console.log();
console.log(chalk.white('Help: ') + chalk.white('cfn-forge --help'));
console.log();
console.log();
}
/**
* Simple welcome display
*/
function showWelcome() {
displayWelcomeBanner();
displayContextualHelp();
}
module.exports = {
showWelcome,
displayWelcomeBanner,
};