Skip to content

Commit

Permalink
hotFix: "AI": false일 때 걸리는 오류해결(#60)
Browse files Browse the repository at this point in the history
- main에 아무커밋이 없을 때 걸리는 오류를 해결함
- AI:false일 때는 OPENAI_API_KEY 키가 없어도 커밋을 할수 있도록함
  • Loading branch information
nakyeonko3 committed Sep 25, 2024
1 parent 4f46e87 commit 2303c18
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions byul.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"byulFormat": "{type}: {commitMessage} (#{issueNumber})",
"AI": true,
"AI": false,
"language": "한국어",
"model": "gpt-4o-mini",
"commitTypes": {
Expand All @@ -18,4 +18,4 @@
"design": "UI/UX design changes like CSS",
"release": "Deployment or release, e.g., release/login-123"
}
}
}
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
dotenv.config();
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
apiKey: process.env.OPENAI_API_KEY || "",
});
const ANSI_COLORS = {
cyan: "\x1b[36m",
Expand Down Expand Up @@ -165,7 +165,7 @@ function getDiffStream(excludePattern = "") {
}
function getBranchName() {
return new Promise((resolve, reject) => {
const git = spawn("git", ["rev-parse", "--abbrev-ref", "HEAD"]);
const git = spawn("git", ["symbolic-ref", "--short", "HEAD"]);
let branchName = "";
git.stdout.on("data", (data) => {
branchName += data.toString().trim();
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const __dirname = dirname(__filename);
dotenv.config();

const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
apiKey: process.env.OPENAI_API_KEY || "",
});

const ANSI_COLORS = {
Expand Down Expand Up @@ -215,7 +215,7 @@ function getDiffStream(excludePattern: string = ""): Promise<string> {

function getBranchName(): Promise<string> {
return new Promise((resolve, reject) => {
const git = spawn("git", ["rev-parse", "--abbrev-ref", "HEAD"]);
const git = spawn("git", ["symbolic-ref", "--short", "HEAD"]);
let branchName = "";

git.stdout.on("data", (data) => {
Expand Down

0 comments on commit 2303c18

Please sign in to comment.