UNPKG

moshai-cli

Version:

A modern, fast Node.js CLI powered by arasadrahman

31 lines (25 loc) • 1.13 kB
const git = require('simple-git')(); const chalk = require('chalk').default; module.exports = class PullCommand { static signature = 'git:pull'; static description = 'Pull latest changes from remote'; async handle() { try { const result = await git.pull(); console.log(chalk.green('āœ… Pulled latest changes!')); if (result.summary.changes || result.summary.insertions || result.summary.deletions) { console.log(chalk.blue(`šŸ“„ Files changed: ${result.summary.changes}`)); console.log(chalk.green(`āž• Insertions: ${result.summary.insertions}`)); console.log(chalk.red(`āž– Deletions: ${result.summary.deletions}`)); } if (result.files.length > 0) { console.log(chalk.yellow('\nšŸ“ Changed files:')); for (const file of result.files) { console.log(` - ${file}`); } } } catch (err) { console.error(chalk.red('āŒ Pull failed:'), err.message); } } };