job51-gitlab-cr-node-jt-1 2.1.4 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -119,7 +119,7 @@ class GitLabCodeReviewer {
|
|
|
119
119
|
const processBlock = async (diffObject, blockIndex) => {
|
|
120
120
|
// 创建临时文件存储diff内容,文件地址选择当前文件夹下,避免权限问题
|
|
121
121
|
const fileName = `temp-diff-block-${Date.now()}-${blockIndex}.diff`;
|
|
122
|
-
const tmpFileName = path.join(
|
|
122
|
+
const tmpFileName = path.join(process.cwd(), fileName);
|
|
123
123
|
|
|
124
124
|
try {
|
|
125
125
|
// 构造包含元数据的 diff 内容
|
|
@@ -542,8 +542,8 @@ async function main() {
|
|
|
542
542
|
function runClaudeCommand(promptContent) {
|
|
543
543
|
return new Promise((resolve, reject) => {
|
|
544
544
|
|
|
545
|
-
//
|
|
546
|
-
const projectDir = process.
|
|
545
|
+
// 使用当前工作目录,确保 Claude 能访问临时文件和项目代码
|
|
546
|
+
const projectDir = process.cwd();
|
|
547
547
|
debugLog("AI review命令开始时间, 工作目录:" + projectDir);
|
|
548
548
|
|
|
549
549
|
// 使用spawn替代exec,更安全地处理命令执行并实现环境隔离
|