Skip to content

Commit

Permalink
fix: explicit exit code and return in review index
Browse files Browse the repository at this point in the history
  • Loading branch information
gowoons committed Aug 7, 2023
1 parent 81097f1 commit 9bb8140
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/common/git/getFilesWithChanges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const getFilesWithChanges = async (
logger.warn(
"No files with changes found, you might need to stage your changes."
);
exit();
exit(0);
}

const files = await Promise.all(
Expand Down
9 changes: 6 additions & 3 deletions src/review/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import { askAI } from "./llm/askAI";
import { constructPromptsArray } from "./prompt/constructPrompt/constructPrompt";
import { filterFiles } from "./prompt/filterFiles";

export const review = async (yargs: ReviewArgs, files: ReviewFile[]) => {
export const review = async (
yargs: ReviewArgs,
files: ReviewFile[]
): Promise<void> => {
logger.debug(`Review started.`);
logger.debug(`Model used: ${yargs.model}`);
logger.debug(`Ci enabled: ${yargs.ci}`);
Expand All @@ -25,8 +28,8 @@ export const review = async (yargs: ReviewArgs, files: ReviewFile[]) => {
const filteredFiles = filterFiles(files);

if (filteredFiles.length == 0) {
logger.info("No file to review, exiting now.");
exit();
logger.info("No file to review, finishing review now.");
return;
}

logger.debug(
Expand Down

0 comments on commit 9bb8140

Please sign in to comment.