cfn-forge
Version:
CloudFormation deployment automation tool with git-based workflows
35 lines (28 loc) • 744 B
JavaScript
/**
* Dependency checking utilities for CFN-Forge
*/
const { execSync } = require('child_process');
const { logger } = require('./logger');
async function checkDependencies({ aws = false, git = false } = {}) {
const missing = [];
if (aws) {
try {
execSync('aws --version', { stdio: 'ignore' });
} catch {
missing.push('AWS CLI');
}
}
if (git) {
try {
execSync('git --version', { stdio: 'ignore' });
} catch {
missing.push('Git');
}
}
if (missing.length > 0) {
logger.error(`Missing required dependencies: ${missing.join(', ')}`);
logger.info('Please install the missing dependencies and try again.');
process.exit(1);
}
}
module.exports = { checkDependencies };