cwm-assistant 0.4.1 → 0.4.2
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.
|
@@ -2619,7 +2619,7 @@ var Type = type_exports2;
|
|
|
2619
2619
|
|
|
2620
2620
|
// ../../packages/contracts/src/assistant.ts
|
|
2621
2621
|
var ASSISTANT_PROTOCOL = 1;
|
|
2622
|
-
var ASSISTANT_VERSION = "0.4.
|
|
2622
|
+
var ASSISTANT_VERSION = "0.4.2";
|
|
2623
2623
|
var ASSISTANT_PORT = 46322;
|
|
2624
2624
|
|
|
2625
2625
|
// ../../packages/contracts/src/index.ts
|
|
@@ -6148,9 +6148,11 @@ async function auditLocalVersion(initial, root, runId, inputHash, body, log) {
|
|
|
6148
6148
|
const results = [], folders = [];
|
|
6149
6149
|
const groups = [...new Set(includedMounts.map((mount) => mount.repository_id))];
|
|
6150
6150
|
const emptyRepositories = /* @__PURE__ */ new Set();
|
|
6151
|
-
log("\u5BA1\u67E5\u4ED3\u5E93\u603B\u6570\uFF1A" + groups.length);
|
|
6152
6151
|
excludedRepositories.forEach((repo) => log("\u5DF2\u6392\u9664\uFF1A" + repo.alias + "\uFF08" + repo.reason + "\uFF09"));
|
|
6153
|
-
|
|
6152
|
+
let kept = 0;
|
|
6153
|
+
const reportTotal = (remaining) => log("\u5BA1\u67E5\u4ED3\u5E93\u603B\u6570\uFF1A" + (kept + remaining));
|
|
6154
|
+
reportTotal(groups.length);
|
|
6155
|
+
for (const [index, repositoryId] of groups.entries()) {
|
|
6154
6156
|
const entries = includedMounts.filter((entry) => entry.repository_id === repositoryId), repo = entries[0];
|
|
6155
6157
|
const directory = path26.join(root, repositoryId.replace(/[^a-zA-Z0-9_-]/g, "_"));
|
|
6156
6158
|
const result2 = {
|
|
@@ -6176,9 +6178,8 @@ async function auditLocalVersion(initial, root, runId, inputHash, body, log) {
|
|
|
6176
6178
|
if (!localOrigin && !/^(https:\/\/|ssh:\/\/|[\w.-]+@[\w.-]+:)/.test(remote) || remote.includes("::") || /[\s\x00-\x1f]/.test(remote) || /https?:\/\/[^/]*@/.test(remote))
|
|
6177
6179
|
throw new Error("\u8FDC\u7AEF\u5730\u5740\u65E0\u6548");
|
|
6178
6180
|
await git3(root, ["clone", "--no-checkout", "--no-local", "--", remote, directory]);
|
|
6179
|
-
folders.push({ name: repo.alias, path: directory });
|
|
6180
6181
|
result2.remoteRefs = await frozenRefs(git3, directory);
|
|
6181
|
-
log("\
|
|
6182
|
+
log("\u5DF2\u83B7\u53D6\u8FDC\u7AEF\u5FEB\u7167\uFF1A" + repo.alias);
|
|
6182
6183
|
const resolveBranch = async (branch) => {
|
|
6183
6184
|
if (!valid(branch)) throw new Error("\u9700\u6C42\u5206\u652F\u540D\u65E0\u6548\u6216\u7F3A\u5931");
|
|
6184
6185
|
const clean = branch.replace(/^refs\/remotes\/origin\//, "").replace(/^origin\//, "").replace(/^refs\/heads\//, "");
|
|
@@ -6207,18 +6208,20 @@ async function auditLocalVersion(initial, root, runId, inputHash, body, log) {
|
|
|
6207
6208
|
if (!activeEntries.length) {
|
|
6208
6209
|
results.splice(results.indexOf(result2), 1);
|
|
6209
6210
|
emptyRepositories.add(repositoryId);
|
|
6210
|
-
const folderIndex = folders.findIndex((folder) => folder.name === repo.alias);
|
|
6211
|
-
if (folderIndex >= 0) folders.splice(folderIndex, 1);
|
|
6212
6211
|
excludedRepositories.push({
|
|
6213
6212
|
repositoryId,
|
|
6214
6213
|
alias: repo.alias,
|
|
6215
6214
|
reason: "\u5206\u652F\u76F8\u5BF9 " + compareName + " \u65E0\u6539\u52A8"
|
|
6216
6215
|
});
|
|
6217
6216
|
log("\u5DF2\u6392\u9664\uFF1A" + repo.alias + "\uFF08\u5206\u652F\u76F8\u5BF9 " + compareName + " \u65E0\u6539\u52A8\uFF09");
|
|
6217
|
+
reportTotal(groups.length - index - 1);
|
|
6218
6218
|
continue;
|
|
6219
6219
|
}
|
|
6220
6220
|
entries.length = 0;
|
|
6221
6221
|
entries.push(...activeEntries);
|
|
6222
|
+
folders.push({ name: repo.alias, path: directory });
|
|
6223
|
+
kept += 1;
|
|
6224
|
+
log("\u4ED3\u5E93\u5FEB\u7167\u5DF2\u83B7\u53D6\uFF1A" + repo.alias);
|
|
6222
6225
|
const p = await resolveBranch(production), s = await resolveBranch(staging);
|
|
6223
6226
|
result2.refs = { production: p, staging: s };
|
|
6224
6227
|
for (const branch of [...new Set(activeEntries.map((entry) => entry.branch))])
|
|
@@ -6947,4 +6950,4 @@ async function cli(args, entry) {
|
|
|
6947
6950
|
export {
|
|
6948
6951
|
cli
|
|
6949
6952
|
};
|
|
6950
|
-
//# sourceMappingURL=cli-
|
|
6953
|
+
//# sourceMappingURL=cli-FQPKDTQT.js.map
|