testes/.agent/scripts/git-commit-by-day.js

22 lines
714 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* Runner para GitSyncAgent.commitByDay().
* Uso: npm run agent:git:commit [-- --dry-run]
*/
import { GitSyncAgent } from '../agents/GitSyncAgent.js';
const dryRun = process.argv.includes('--dry-run');
const agent = new GitSyncAgent();
const result = await agent.commitByDay({ dryRun });
if (result.userMessage) console.log('\n⚠ ' + result.userMessage);
if (result.retryPrompt) console.log('➡️ ' + result.retryPrompt);
if (result.commits?.length) {
console.log('\n📦 Commits:', result.commits.length);
result.commits.forEach((c) => console.log(` ${c.date}: ${c.message}`));
}
if (result.errors?.length) console.error('\n❌ Erros:', result.errors);
process.exit(result.passed ? 0 : 1);