File tree Expand file tree Collapse file tree 2 files changed +41
-2
lines changed Expand file tree Collapse file tree 2 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 33 "version" : " 0.1.0" ,
44 "description" : " GitHub Action inteligente para transformar TODOs em issues e tarefas rastreáveis." ,
55 "main" : " dist/index.js" ,
6+ "bin" : {
7+ "todo-action" : " dist/main.js"
8+ },
69 "scripts" : {
710 "build" : " tsc" ,
811 "test" : " vitest run" ,
Original file line number Diff line number Diff line change 1- // Ponto de entrada da Action
1+ #!/usr/bin/env node
2+ // Simple CLI entrypoint
23
3- console . log ( 'TODO Watcher iniciado' ) ;
4+ import { extractTodosFromDir } from './parser/extractTodosFromDir' ;
5+ import { generateMarkdownReport } from './core/report' ;
6+
7+ interface Options {
8+ dir: string ;
9+ report: boolean ;
10+ }
11+
12+ function parseArgs ( ) : Options {
13+ const args = process . argv . slice ( 2 ) ;
14+ const opts : Options = { dir : '.' , report : false } ;
15+
16+ for ( let i = 0 ; i < args . length ; i ++ ) {
17+ const arg = args [ i ] ;
18+ if ( ( arg === '--dir' || arg === '-d' ) && args [ i + 1 ] ) {
19+ opts . dir = args [ ++ i ] ;
20+ } else if ( arg === '--report' || arg === '-r' ) {
21+ opts . report = true ;
22+ }
23+ }
24+
25+ return opts ;
26+ }
27+
28+ function run ( ) : void {
29+ const { dir, report } = parseArgs ( ) ;
30+ const todos = extractTodosFromDir ( dir ) ;
31+ console . log ( `\u{1F50D} Found ${ todos . length } TODOs` ) ;
32+
33+ if ( report ) {
34+ generateMarkdownReport ( todos ) ;
35+ console . log ( '📝 Generated TODO_REPORT.md' ) ;
36+ }
37+ }
38+
39+ run ( ) ;
You can’t perform that action at this time.
0 commit comments