@pubinfo/commitlint 2.0.8 → 2.0.10

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, configureGitHooksPath, createCzConfig, createGitMessage, isCommitlintEnabled, isInsideGitRepo, lintAndReturn, lintMessage, loadCommitConfig, runCzConfig, runGitMessage, runNpx, runPrompt, runSimpleGitHooks } from "./lint.message-CLvOoZVL.js";
1
+ import { commitPreset, configureGitHooksPath, createCzConfig, createGitMessage, isCommitlintEnabled, isInsideGitRepo, lintAndReturn, lintMessage, loadCommitConfig, runCzConfig, runGitMessage, runNpx, runPrompt, runSimpleGitHooks } from "./lint.message-heD3VHdS.js";
2
2
 
3
3
  export { commitPreset, configureGitHooksPath, createCzConfig, createGitMessage, isCommitlintEnabled, isInsideGitRepo, lintAndReturn, lintMessage, loadCommitConfig, runCzConfig, runGitMessage, runNpx, runPrompt, runSimpleGitHooks };
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from "node:module";
2
2
  import { execSync, spawn } from "node:child_process";
3
3
  import { loadConfig } from "unconfig";
4
- import { resolve } from "node:path";
4
+ import { join, resolve } from "node:path";
5
5
  import process$1 from "node:process";
6
6
  import CZGPackage from "czg/package.json" with { type: "json" };
7
7
  import fs from "node:fs";
@@ -2348,10 +2348,19 @@ async function runPrompt() {
2348
2348
  if (api$1 && api$1.raw) return { raw: api$1.raw };
2349
2349
  }
2350
2350
  } catch {}
2351
- const bin = resolve(process$1.cwd(), "node_modules/.bin/czg");
2352
- if (fs.existsSync(bin)) {
2351
+ const binDir = resolve(process$1.cwd(), "node_modules/.bin");
2352
+ const isWin = process$1.platform === "win32";
2353
+ const czgBin = (isWin ? [
2354
+ join(binDir, "czg.cmd"),
2355
+ join(binDir, "czg.ps1"),
2356
+ join(binDir, "czg")
2357
+ ] : [join(binDir, "czg")]).find((p) => fs.existsSync(p));
2358
+ if (czgBin) {
2353
2359
  await new Promise((res) => {
2354
- const child = spawn(bin, [], { stdio: "inherit" });
2360
+ const child = spawn(czgBin, [], {
2361
+ stdio: "inherit",
2362
+ shell: isWin
2363
+ });
2355
2364
  child.on("exit", () => res());
2356
2365
  child.on("error", () => res());
2357
2366
  });
package/dist/run.js CHANGED
@@ -1,4 +1,4 @@
1
- import { configureGitHooksPath, createCzConfig, createGitMessage, isCommitlintEnabled, isInsideGitRepo, lintMessage, runCzConfig, runGitMessage, runNpx, runPrompt, runSimpleGitHooks } from "./lint.message-CLvOoZVL.js";
1
+ import { configureGitHooksPath, createCzConfig, createGitMessage, isCommitlintEnabled, isInsideGitRepo, lintMessage, runCzConfig, runGitMessage, runNpx, runPrompt, runSimpleGitHooks } from "./lint.message-heD3VHdS.js";
2
2
  import process from "node:process";
3
3
  import fs from "node:fs";
4
4
  import { defineCommand, runMain as runMain$1 } from "citty";
@@ -6,7 +6,7 @@ import { defineCommand, runMain as runMain$1 } from "citty";
6
6
  //#region package.json
7
7
  var name = "@pubinfo/commitlint";
8
8
  var type = "module";
9
- var version = "2.0.8";
9
+ var version = "2.0.10";
10
10
  var description = "commitlint config for Pubinfo projects";
11
11
  var exports = { ".": "./dist/index.js" };
12
12
  var main$1 = "./dist/index.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pubinfo/commitlint",
3
3
  "type": "module",
4
- "version": "2.0.8",
4
+ "version": "2.0.10",
5
5
  "description": "commitlint config for Pubinfo projects",
6
6
  "exports": {
7
7
  ".": "./dist/index.js"