@bragduck/cli 2.16.1 → 2.16.3
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/bragduck.js +44 -14
- package/dist/bin/bragduck.js.map +1 -1
- package/package.json +1 -1
package/dist/bin/bragduck.js
CHANGED
|
@@ -4890,12 +4890,12 @@ async function syncSingleService(sourceType, options, TOTAL_STEPS) {
|
|
|
4890
4890
|
logger.log(formatRefinedCommitsTable(refinedBrags, newCommits));
|
|
4891
4891
|
logger.log("");
|
|
4892
4892
|
acceptedBrags = await promptReviewBrags(refinedBrags, newCommits);
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
}
|
|
4893
|
+
}
|
|
4894
|
+
if (acceptedBrags.length === 0) {
|
|
4895
|
+
logger.log("");
|
|
4896
|
+
logger.info(theme.secondary("No brags selected for creation. Sync cancelled."));
|
|
4897
|
+
logger.log("");
|
|
4898
|
+
return { created: 0, skipped: duplicates.length };
|
|
4899
4899
|
}
|
|
4900
4900
|
logger.log("");
|
|
4901
4901
|
let selectedOrgId = null;
|
|
@@ -4940,14 +4940,32 @@ async function syncSingleService(sourceType, options, TOTAL_STEPS) {
|
|
|
4940
4940
|
};
|
|
4941
4941
|
})
|
|
4942
4942
|
};
|
|
4943
|
-
const
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4943
|
+
const CREATE_TIMEOUT = 6e4;
|
|
4944
|
+
logger.debug(`Sending ${acceptedBrags.length} brags to API for creation...`);
|
|
4945
|
+
let createResponse;
|
|
4946
|
+
try {
|
|
4947
|
+
createResponse = await Promise.race([
|
|
4948
|
+
apiService.createBrags(createRequest),
|
|
4949
|
+
new Promise((_, reject) => {
|
|
4950
|
+
setTimeout(
|
|
4951
|
+
() => reject(new Error("Create brags timeout after 60 seconds")),
|
|
4952
|
+
CREATE_TIMEOUT
|
|
4953
|
+
);
|
|
4954
|
+
})
|
|
4955
|
+
]);
|
|
4956
|
+
logger.debug(`API response: ${createResponse.created} brags created`);
|
|
4957
|
+
succeedStepSpinner(
|
|
4958
|
+
createSpinner2,
|
|
4959
|
+
5,
|
|
4960
|
+
TOTAL_STEPS,
|
|
4961
|
+
`Created ${theme.count(createResponse.created)} brag${createResponse.created > 1 ? "s" : ""}`
|
|
4962
|
+
);
|
|
4963
|
+
logger.log("");
|
|
4964
|
+
} catch (error) {
|
|
4965
|
+
failStepSpinner(createSpinner2, 5, TOTAL_STEPS, "Failed to create brags");
|
|
4966
|
+
logger.log("");
|
|
4967
|
+
throw error;
|
|
4968
|
+
}
|
|
4951
4969
|
return { created: createResponse.created, skipped: duplicates.length };
|
|
4952
4970
|
}
|
|
4953
4971
|
async function syncAllAuthenticatedServices(options) {
|
|
@@ -5116,6 +5134,18 @@ async function syncCommand(options = {}) {
|
|
|
5116
5134
|
const result = await syncSingleService(sourceType, options, TOTAL_STEPS);
|
|
5117
5135
|
if (result.created > 0) {
|
|
5118
5136
|
logger.log(boxen6(formatSuccessMessage(result.created), boxStyles.success));
|
|
5137
|
+
} else if (result.skipped > 0) {
|
|
5138
|
+
logger.log("");
|
|
5139
|
+
logger.info(
|
|
5140
|
+
theme.secondary(
|
|
5141
|
+
`No new brags created. ${result.skipped} item${result.skipped > 1 ? "s were" : " was"} skipped (already exists in Bragduck).`
|
|
5142
|
+
)
|
|
5143
|
+
);
|
|
5144
|
+
logger.log("");
|
|
5145
|
+
} else {
|
|
5146
|
+
logger.log("");
|
|
5147
|
+
logger.info(theme.secondary("No brags created."));
|
|
5148
|
+
logger.log("");
|
|
5119
5149
|
}
|
|
5120
5150
|
}
|
|
5121
5151
|
} catch (error) {
|