|
17 | 17 | import os |
18 | 18 | from datetime import datetime |
19 | 19 | from analyzer import GitHubRepoAnalyzer |
20 | | -from output import generate_all_outputs |
| 20 | +import output |
21 | 21 | from utils import setup_ssl_warnings, get_env_variables, validate_required_args, should_show_progress |
22 | 22 |
|
23 | 23 | def main(): |
@@ -50,6 +50,11 @@ def main(): |
50 | 50 | type=str, |
51 | 51 | help='GitHub Personal Access Token (can also use GITHUB_TOKEN environment variable)' |
52 | 52 | ) |
| 53 | + parser.add_argument( |
| 54 | + '--output', |
| 55 | + type=str, |
| 56 | + help='Base filename for output files (without extension)' |
| 57 | + ) |
53 | 58 | parser.add_argument( |
54 | 59 | '--output-dir', |
55 | 60 | type=str, |
@@ -208,11 +213,17 @@ def validate_positive_int(value): |
208 | 213 | print("No repositories found or analyzed.") |
209 | 214 | return |
210 | 215 |
|
211 | | - # Generate output files |
212 | | - base_filename = f"{org}_repos_{timestamp}" |
| 216 | + # Save results to files |
| 217 | + output_filename = args.output or f"github_analysis_{org}_{datetime.now().strftime('%Y%m%d_%H%M%S')}" |
| 218 | + print(f"💾 Saving results to {output_filename}...") |
| 219 | + |
| 220 | + if args.analyze_only: |
| 221 | + # For analyze-only mode, generate HTML dashboard by default |
| 222 | + output.save_to_html(repo_data, os.path.join(args.output_dir, f"{output_filename}.html")) |
| 223 | + print(f"🌐 Interactive HTML dashboard created: {output_filename}.html") |
| 224 | + print(" Open this file in your browser to explore quality configurations!") |
213 | 225 |
|
214 | | - # Save to different formats |
215 | | - generate_all_outputs(repo_data, base_filename, args.output_dir) |
| 226 | + output.generate_all_outputs(repo_data, output_filename, args.output_dir) |
216 | 227 |
|
217 | 228 | # Print summary |
218 | 229 | end_time = datetime.now() |
|
0 commit comments