ai-project-manage-cli 4.0.4 → 4.0.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/dist/index.js +8 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -817,11 +817,17 @@ async function fetchBaselineBranchFromApi(requirementId, cwd) {
|
|
|
817
817
|
const cfg = await ensureLoggedConfig();
|
|
818
818
|
const api = createApmApiClient(cfg);
|
|
819
819
|
const workdirPath = resolve3(cwd);
|
|
820
|
-
const
|
|
820
|
+
const res = await api.cliRequirements.branchBaseline({
|
|
821
821
|
requirementId,
|
|
822
822
|
workdirPath
|
|
823
823
|
});
|
|
824
|
-
|
|
824
|
+
if (!res.repositoryId) {
|
|
825
|
+
throw new Error(
|
|
826
|
+
`[apm] \u672A\u5728\u5E73\u53F0\u627E\u5230\u4E0E\u5F53\u524D\u76EE\u5F55\u5339\u914D\u7684\u5DE5\u4F5C\u76EE\u5F55\u767B\u8BB0\uFF1A${workdirPath}
|
|
827
|
+
\u8BF7\u5148\u5728\u5E73\u53F0\u767B\u8BB0\u8BE5\u8DEF\u5F84\u5BF9\u5E94\u7684\u5DE5\u4F5C\u76EE\u5F55\u4E0E\u4ED3\u5E93\u3002`
|
|
828
|
+
);
|
|
829
|
+
}
|
|
830
|
+
const name = (res.defaultBranch ?? "").trim();
|
|
825
831
|
if (!name) {
|
|
826
832
|
throw new Error("[apm] \u5E73\u53F0\u8FD4\u56DE\u7684\u57FA\u7EBF\u5206\u652F\u540D\u4E3A\u7A7A");
|
|
827
833
|
}
|