repowise 0.1.68 → 0.1.69
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/dist/bin/repowise.js +26 -0
- package/package.json +1 -1
package/dist/bin/repowise.js
CHANGED
|
@@ -2768,12 +2768,16 @@ async function sync() {
|
|
|
2768
2768
|
return;
|
|
2769
2769
|
}
|
|
2770
2770
|
let repoId;
|
|
2771
|
+
let repoPlatform;
|
|
2772
|
+
let repoExternalId;
|
|
2771
2773
|
spinner.start("Resolving repository...");
|
|
2772
2774
|
try {
|
|
2773
2775
|
const repos = await apiRequest("/v1/repos");
|
|
2774
2776
|
const match = repos.find((r) => r.name === repoName || r.fullName.endsWith(`/${repoName}`));
|
|
2775
2777
|
if (match) {
|
|
2776
2778
|
repoId = match.repoId;
|
|
2779
|
+
repoPlatform = match.platform;
|
|
2780
|
+
repoExternalId = match.externalId;
|
|
2777
2781
|
}
|
|
2778
2782
|
} catch {
|
|
2779
2783
|
}
|
|
@@ -2893,6 +2897,28 @@ async function sync() {
|
|
|
2893
2897
|
spinner.warn(chalk8.yellow(`Could not download context files: ${msg}
|
|
2894
2898
|
Retry when online.`));
|
|
2895
2899
|
}
|
|
2900
|
+
if (repoRoot && repoId) {
|
|
2901
|
+
try {
|
|
2902
|
+
const existingConfig = await getConfig();
|
|
2903
|
+
const existingRepos = existingConfig.repos ?? [];
|
|
2904
|
+
if (!existingRepos.some((r) => r.repoId === repoId)) {
|
|
2905
|
+
const repoEntry = { repoId, localPath: repoRoot };
|
|
2906
|
+
if (isStagingMode()) {
|
|
2907
|
+
repoEntry.apiUrl = getEnvConfig().apiUrl;
|
|
2908
|
+
}
|
|
2909
|
+
if (repoPlatform) repoEntry.platform = repoPlatform;
|
|
2910
|
+
if (repoExternalId) repoEntry.externalId = repoExternalId;
|
|
2911
|
+
existingRepos.push(repoEntry);
|
|
2912
|
+
await saveConfig({ ...existingConfig, repos: existingRepos });
|
|
2913
|
+
}
|
|
2914
|
+
} catch {
|
|
2915
|
+
}
|
|
2916
|
+
try {
|
|
2917
|
+
await install();
|
|
2918
|
+
await startBackground();
|
|
2919
|
+
} catch {
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2896
2922
|
const elapsed = formatElapsed2(Date.now() - startTime);
|
|
2897
2923
|
console.log(chalk8.dim(`
|
|
2898
2924
|
Total time: ${elapsed}`));
|