@puls-atlas/cli
Version:
The Puls Atlas CLI tool for managing Atlas projects
44 lines • 1.13 kB
JavaScript
import chalk from 'chalk';
import inquirer from 'inquirer';
import logger from './logger.js';
import execSync from './execSync.js';
const install = async (options = {}) => {
logger.info('Simulating composer install...');
execSync('composer install --dry-run');
const {
isConfirmed
} = await inquirer.prompt([{
type: 'confirm',
name: 'isConfirmed',
default: true,
message: 'Continue installing the latest ' + `${chalk.yellow('Composer dependencies')}`
}]);
if (isConfirmed) {
execSync('composer install', {
log: true,
ignorePlatformReqs: options.force
});
}
};
const update = async (options = {}) => {
logger.info('Simulating composer update...');
execSync('composer update --dry-run');
const {
isConfirmed
} = await inquirer.prompt([{
type: 'confirm',
name: 'isConfirmed',
default: true,
message: 'Continue updating the latest ' + `${chalk.yellow('Composer dependencies')}`
}]);
if (isConfirmed) {
execSync('composer update', {
log: true,
ignorePlatformReqs: options.force
});
}
};
export default {
install,
update
};