@pubinfo/commitlint 2.0.0-rc.2 → 2.0.0-rc.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/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { commitPreset, createCommitTemplate, createCzConfigFile, ensureGitTemplate, ensurePackageGitHooks, initCommitEnvironment, lintAndReturn, lintMessage, loadCommitConfig, runMain, runPrompt } from "./run-DOVoS-Vy.js";
1
+ import { commitPreset, createCommitTemplate, createCzConfigFile, ensureGitTemplate, ensurePackageGitHooks, initCommitEnvironment, lintAndReturn, lintMessage, loadCommitConfig, runMain, runPrompt } from "./run-kpuZDnr9.js";
2
2
 
3
3
  export { commitPreset, createCommitTemplate, createCzConfigFile, ensureGitTemplate, ensurePackageGitHooks, initCommitEnvironment, lintAndReturn, lintMessage, loadCommitConfig, runMain, runPrompt };
@@ -8,16 +8,31 @@ import { defineCommand, runMain } from "citty";
8
8
  //#region src/config.ts
9
9
  function isMainBranch() {
10
10
  try {
11
- const currentBranch = execSync("git rev-parse --abbrev-ref HEAD", { encoding: "utf8" }).trim();
12
- return [
13
- "main",
14
- "master",
15
- "dev",
16
- "test"
17
- ].includes(currentBranch);
11
+ try {
12
+ const currentBranch = execSync("git branch --show-current", { encoding: "utf8" }).trim();
13
+ if (currentBranch) return [
14
+ "main",
15
+ "master",
16
+ "dev",
17
+ "test"
18
+ ].includes(currentBranch);
19
+ } catch {
20
+ try {
21
+ const currentBranch = execSync("git symbolic-ref --short HEAD", { encoding: "utf8" }).trim();
22
+ return [
23
+ "main",
24
+ "master",
25
+ "dev",
26
+ "test"
27
+ ].includes(currentBranch);
28
+ } catch {
29
+ return false;
30
+ }
31
+ }
18
32
  } catch {
19
33
  return false;
20
34
  }
35
+ return false;
21
36
  }
22
37
  function generateCommitTypes() {
23
38
  const allTypes = [
@@ -250,7 +265,7 @@ async function runPrompt(cfg, opts) {
250
265
  //#region package.json
251
266
  var name = "@pubinfo/commitlint";
252
267
  var type = "module";
253
- var version = "2.0.0-rc.2";
268
+ var version = "2.0.0-rc.3";
254
269
  var description = "commitlint config for Pubinfo projects";
255
270
  var exports = { ".": "./dist/index.js" };
256
271
  var main$1 = "./dist/index.js";
package/dist/run.js CHANGED
@@ -1,3 +1,3 @@
1
- import { runMain } from "./run-DOVoS-Vy.js";
1
+ import { runMain } from "./run-kpuZDnr9.js";
2
2
 
3
3
  export { runMain };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pubinfo/commitlint",
3
3
  "type": "module",
4
- "version": "2.0.0-rc.2",
4
+ "version": "2.0.0-rc.3",
5
5
  "description": "commitlint config for Pubinfo projects",
6
6
  "exports": {
7
7
  ".": "./dist/index.js"