瀏覽代碼

Update pre-publish script

Loris Leiva 1 年之前
父節點
當前提交
f1d258d534
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      scripts/prepublish.mjs

+ 6 - 2
scripts/prepublish.mjs

@@ -14,8 +14,8 @@ for (const projectName of projects) {
   const projectDirectory = path.resolve(projectsDirectory, projectName);
   cd(projectDirectory);
 
+  // Add all changes and commit them.
   await $`git add -A .`;
-
   try {
     await $`git commit -m "version ${version} snapshot"`;
   } catch (e) {
@@ -24,10 +24,14 @@ for (const projectName of projects) {
     }
   }
 
+  // Tag the commit.
   await $`git tag -m "v${version}" v${version}`;
-  await $`git push --follow-tags`;
+
+  // Push the changes on main.
+  await $`git push origin HEAD:main --follow-tags`;
 }
 
+// Update submodules on the root directory.
 cd(rootDirectory);
 await $`git add projects`;
 await $`git commit -m 'Update snapshot' --allow-empty`;