diff --git a/byul.config.json b/byul.config.json index 45cf20c..a6cb95b 100644 --- a/byul.config.json +++ b/byul.config.json @@ -18,4 +18,4 @@ "design": "UI/UX design changes like CSS", "release": "Deployment or release, e.g., release/login-123" } -} \ No newline at end of file +} diff --git a/dist/index.js b/dist/index.js index f72f084..48c4c05 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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", @@ -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(); diff --git a/package-lock.json b/package-lock.json index 2c4ac27..b02a1da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "byul", - "version": "2.0.0", + "version": "2.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "byul", - "version": "2.0.0", + "version": "2.0.2", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/src/index.ts b/src/index.ts index d799a19..c47dc45 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 = { @@ -215,7 +215,7 @@ function getDiffStream(excludePattern: string = ""): Promise { function getBranchName(): Promise { 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) => {