Skip to content

🎥 Make videos programmatically with React

Update set-version.ts

JonnyBurgere4cdcc919611
diff --git a/set-version.ts b/set-version.ts
index 3712e385b5..47b23154b3 100644
--- a/set-version.ts
+++ b/set-version.ts
@@ -22,6 +22,17 @@ if (version.startsWith('v')) {
version = version.slice(1);
}
+// Ensure we are on the main branch
+const currentBranch = execSync('git rev-parse --abbrev-ref HEAD', {
+ encoding: 'utf-8',
+}).trim();
+
+if (currentBranch !== 'main') {
+ throw new Error(
+ `You must be on the main branch to set a version. Current branch: ${currentBranch}`,
+ );
+}
+
const dirs = readdirSync('packages')
.filter((dir) =>
lstatSync(path.join(process.cwd(), 'packages', dir)).isDirectory(),