ardent-cli 0.0.40 → 0.0.41
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 +18 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -510,11 +510,15 @@ async function createAction(name, options) {
|
|
|
510
510
|
try {
|
|
511
511
|
const startTime = performance.now();
|
|
512
512
|
const connectorId = await requireCurrentConnectorId();
|
|
513
|
-
await api.post(
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
513
|
+
const createResponse = await api.post(
|
|
514
|
+
"/v1/branch/create",
|
|
515
|
+
{
|
|
516
|
+
connector_id: connectorId,
|
|
517
|
+
service_type: options.service,
|
|
518
|
+
name
|
|
519
|
+
}
|
|
520
|
+
);
|
|
521
|
+
const warning = createResponse?.warning;
|
|
518
522
|
const response = await api.get(`/v1/cli/branches?connector_id=${connectorId}`);
|
|
519
523
|
const apiBranches = response.branches || [];
|
|
520
524
|
let apiBranch;
|
|
@@ -544,12 +548,20 @@ async function createAction(name, options) {
|
|
|
544
548
|
setCacheEntry("branches", cachedBranches);
|
|
545
549
|
setCurrentBranch(name);
|
|
546
550
|
const elapsed = ((performance.now() - startTime) / 1e3).toFixed(1);
|
|
547
|
-
trackEvent("CLI: branch create succeeded", {
|
|
551
|
+
trackEvent("CLI: branch create succeeded", {
|
|
552
|
+
service_type: options.service,
|
|
553
|
+
duration_seconds: parseFloat(elapsed),
|
|
554
|
+
warning_type: warning?.type
|
|
555
|
+
});
|
|
548
556
|
console.log(`\u2713 Branch '${name}' created and checked out in ${elapsed}s`);
|
|
549
557
|
if (branch.branch_url) {
|
|
550
558
|
console.log(`
|
|
551
559
|
${branch.branch_url}`);
|
|
552
560
|
}
|
|
561
|
+
if (warning) {
|
|
562
|
+
console.log(`
|
|
563
|
+
! ${warning.message}`);
|
|
564
|
+
}
|
|
553
565
|
} catch (err) {
|
|
554
566
|
if (isNetworkError(err)) {
|
|
555
567
|
trackEvent("CLI: branch create failed", { reason: "offline" });
|