@ucdjs/release-scripts 0.1.0-beta.22 → 0.1.0-beta.23
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.mjs +6 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1458,8 +1458,12 @@ async function normalizeReleaseOptions(options) {
|
|
|
1458
1458
|
if (!defaultBranch) exitWithError("Could not determine default branch", "Please specify the default branch in options");
|
|
1459
1459
|
}
|
|
1460
1460
|
if (defaultBranch === releaseBranch) exitWithError(`Default branch and release branch cannot be the same: "${defaultBranch}"`, "Specify different branches for default and release");
|
|
1461
|
-
const
|
|
1462
|
-
|
|
1461
|
+
const localBranchExists = await doesBranchExist(defaultBranch, normalized.workspaceRoot);
|
|
1462
|
+
const remoteBranchExists = await doesBranchExist(`origin/${defaultBranch}`, normalized.workspaceRoot);
|
|
1463
|
+
if (!localBranchExists && !remoteBranchExists) {
|
|
1464
|
+
const availableBranches = await getAvailableBranches(normalized.workspaceRoot);
|
|
1465
|
+
exitWithError(`Default branch "${defaultBranch}" does not exist in the repository`, `Couldn't find it locally or on the remote 'origin'.\nAvailable local branches: ${availableBranches.join(", ")}`);
|
|
1466
|
+
}
|
|
1463
1467
|
logger.verbose(`Using default branch: ${farver.green(defaultBranch)}`);
|
|
1464
1468
|
return {
|
|
1465
1469
|
...normalized,
|