js-code-detector 0.0.42 → 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));
|
|
@@ -42,7 +42,7 @@ async function umi4SetUp({ targetDirPath }) {
|
|
|
42
42
|
await import_utils.execa.execa(`mv ${yarnLockPath} ${(0, import_path.join)(targetDirPath, "yarn.lock.bak")}`, { shell: true });
|
|
43
43
|
}
|
|
44
44
|
import_utils.logger.info(`正在安装 @umijs/max 并执行 setup 脚本...`);
|
|
45
|
-
const shellExeResult = await import_utils.execa.execa(`cd ${targetDirPath} &&
|
|
45
|
+
const shellExeResult = await import_utils.execa.execa(`cd ${targetDirPath} && npm uninstall @umijs/max && npm install @umijs/max && npx max setup`, { shell: true });
|
|
46
46
|
const tsconfig = await import_utils.tsconfigPaths.loadConfig(targetDirPath);
|
|
47
47
|
let appData = { config: null };
|
|
48
48
|
try {
|