js-code-detector 0.0.43 → 0.0.44
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.
|
@@ -67,7 +67,7 @@ function getGitRepoUrlByToken(gitRepoUrl, gitlabToken) {
|
|
|
67
67
|
const gitlabDomain = urlObj.hostname;
|
|
68
68
|
const projectPath = urlObj.pathname.replace(/\.git/, "");
|
|
69
69
|
if (!gitlabToken) {
|
|
70
|
-
throw new Error("
|
|
70
|
+
throw new Error("未传入 GitLab accessToken");
|
|
71
71
|
}
|
|
72
72
|
if (!projectPath) {
|
|
73
73
|
throw new Error("请传入 GitLab 项目路径(如 dev-team/my-project)");
|
|
@@ -56,10 +56,11 @@ async function cloneGitRepoAndGetDiff(gitRepoUrl, branchName, extra = {}) {
|
|
|
56
56
|
if (err) {
|
|
57
57
|
import_utils.logger.error("临时目录删除失败");
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
let stderr, failed;
|
|
60
|
+
({ stderr, failed } = await import_utils.execa.execa(`mkdir -p ${today}`, { shell: true }));
|
|
61
|
+
(0, import_handleExecaError.handleExecaError)({ failed, stderr });
|
|
60
62
|
import_utils.logger.info("临时目录建立完成");
|
|
61
63
|
try {
|
|
62
|
-
let stderr, failed;
|
|
63
64
|
import_utils.logger.ready(`准备clone 源代码到临时目录下的 ${today}/${import_constants.TARGET} 文件夹`);
|
|
64
65
|
const repoUrl = (0, import_parseGitLabDiffUril.getGitRepoUrlByToken)(gitRepoUrl, token || "");
|
|
65
66
|
await (0, import_gitUtil.cloneRepoWithBranchAndDefault)(repoUrl, branchName, (0, import_path.join)(today, import_constants.TARGET));
|