Skip to content

Commit 24a96c8

Browse files
committed
feature-292-github-action-rename: Replace console.log with logError and ensure process exits on error for improved error management.
1 parent 8dc9658 commit 24a96c8

File tree

3 files changed

+21
-23
lines changed

3 files changed

+21
-23
lines changed

build/cli/index.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47023,8 +47023,8 @@ program
4702347023
.action(async (options) => {
4702447024
const gitInfo = getGitInfo();
4702547025
if ('error' in gitInfo) {
47026-
console.log(gitInfo.error);
47027-
return;
47026+
(0, logger_1.logError)(gitInfo.error);
47027+
process.exit(1);
4702847028
}
4702947029
// Helper function to clean CLI arguments that may have '=' prefix
4703047030
const cleanArg = (value) => {
@@ -47089,7 +47089,6 @@ program
4708947089
`Starting deep code analysis for ${gitInfo.owner}/${gitInfo.repo}/${branch}...`,
4709047090
`Question: ${question.substring(0, 100)}${question.length > 100 ? '...' : ''}`,
4709147091
];
47092-
// logInfo(JSON.stringify(params, null, 2));
4709347092
(0, local_action_1.runLocalAction)(params);
4709447093
});
4709547094
/**
@@ -47108,8 +47107,8 @@ program
4710847107
.action(async (options) => {
4710947108
const gitInfo = getGitInfo();
4711047109
if ('error' in gitInfo) {
47111-
console.log(gitInfo.error);
47112-
return;
47110+
(0, logger_1.logError)(gitInfo.error);
47111+
process.exit(1);
4711347112
}
4711447113
// Helper function to clean CLI arguments that may have '=' prefix
4711547114
const cleanArg = (value) => {
@@ -47189,8 +47188,8 @@ program
4718947188
.action(async (options) => {
4719047189
const gitInfo = getGitInfo();
4719147190
if ('error' in gitInfo) {
47192-
console.log(gitInfo.error);
47193-
return;
47191+
(0, logger_1.logError)(gitInfo.error);
47192+
process.exit(1);
4719447193
}
4719547194
// Helper function to clean CLI arguments that may have '=' prefix
4719647195
const cleanArg = (value) => {
@@ -47264,8 +47263,8 @@ program
4726447263
.action(async (options) => {
4726547264
const gitInfo = getGitInfo();
4726647265
if ('error' in gitInfo) {
47267-
console.log(gitInfo.error);
47268-
return;
47266+
(0, logger_1.logError)(gitInfo.error);
47267+
process.exit(1);
4726947268
}
4727047269
const cleanArg = (v) => (v != null ? (String(v).startsWith('=') ? String(v).substring(1) : String(v)) : '');
4727147270
const issueNumber = cleanArg(options.issue);
@@ -47304,8 +47303,8 @@ program
4730447303
.action(async (options) => {
4730547304
const gitInfo = getGitInfo();
4730647305
if ('error' in gitInfo) {
47307-
console.log(gitInfo.error);
47308-
return;
47306+
(0, logger_1.logError)(gitInfo.error);
47307+
process.exit(1);
4730947308
}
4731047309
const cleanArg = (v) => (v != null ? (String(v).startsWith('=') ? String(v).substring(1) : String(v)) : '');
4731147310
const issueNumber = cleanArg(options.issue);

build/github_action/src/data/repository/branch_repository.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export declare class BranchRepository {
3333
totalCommits: number;
3434
files: {
3535
filename: string;
36-
status: "added" | "removed" | "modified" | "renamed" | "copied" | "changed" | "unchanged";
36+
status: "modified" | "added" | "removed" | "renamed" | "copied" | "changed" | "unchanged";
3737
additions: number;
3838
deletions: number;
3939
changes: number;

src/cli.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ program
6060
const gitInfo = getGitInfo();
6161

6262
if ('error' in gitInfo) {
63-
console.log(gitInfo.error);
64-
return;
63+
logError(gitInfo.error);
64+
process.exit(1);
6565
}
6666

6767
// Helper function to clean CLI arguments that may have '=' prefix
@@ -138,7 +138,6 @@ program
138138
`Question: ${question.substring(0, 100)}${question.length > 100 ? '...' : ''}`,
139139
];
140140

141-
// logInfo(JSON.stringify(params, null, 2));
142141
runLocalAction(params);
143142
});
144143

@@ -159,8 +158,8 @@ program
159158
const gitInfo = getGitInfo();
160159

161160
if ('error' in gitInfo) {
162-
console.log(gitInfo.error);
163-
return;
161+
logError(gitInfo.error);
162+
process.exit(1);
164163
}
165164

166165
// Helper function to clean CLI arguments that may have '=' prefix
@@ -251,8 +250,8 @@ program
251250
const gitInfo = getGitInfo();
252251

253252
if ('error' in gitInfo) {
254-
console.log(gitInfo.error);
255-
return;
253+
logError(gitInfo.error);
254+
process.exit(1);
256255
}
257256

258257
// Helper function to clean CLI arguments that may have '=' prefix
@@ -334,8 +333,8 @@ program
334333
.action(async (options) => {
335334
const gitInfo = getGitInfo();
336335
if ('error' in gitInfo) {
337-
console.log(gitInfo.error);
338-
return;
336+
logError(gitInfo.error);
337+
process.exit(1);
339338
}
340339
const cleanArg = (v: unknown): string => (v != null ? (String(v).startsWith('=') ? String(v).substring(1) : String(v)) : '');
341340
const issueNumber = cleanArg(options.issue);
@@ -375,8 +374,8 @@ program
375374
.action(async (options) => {
376375
const gitInfo = getGitInfo();
377376
if ('error' in gitInfo) {
378-
console.log(gitInfo.error);
379-
return;
377+
logError(gitInfo.error);
378+
process.exit(1);
380379
}
381380
const cleanArg = (v: unknown): string => (v != null ? (String(v).startsWith('=') ? String(v).substring(1) : String(v)) : '');
382381
const issueNumber = cleanArg(options.issue);

0 commit comments

Comments
 (0)