Skip to content

Commit 6ac53f9

Browse files
committed
fix: avoid potential node version problem
1 parent c7a5a24 commit 6ac53f9

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// @ts-check
22
import path from "node:path";
3+
import process from "node:process";
34
import { dir, resolveConfig } from "../utils.js";
45

56
const cliPath = path.resolve(dir(import.meta.url), "..", "bin", "fenge.cli.js");
6-
const defaultConfig = { "*": [`${cliPath} format -u`] };
7+
const defaultConfig = { "*": [`${process.execPath} ${cliPath} format -u`] };
78
export default (await resolveConfig("lint-staged"))?.config ?? defaultConfig;
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// @ts-check
22
import path from "node:path";
3+
import process from "node:process";
34
import { dir, resolveConfig } from "../utils.js";
45

56
const cliPath = path.resolve(dir(import.meta.url), "..", "bin", "fenge.cli.js");
6-
const defaultConfig = { "*": [`${cliPath} lint`] };
7+
const defaultConfig = { "*": [`${process.execPath} ${cliPath} lint`] };
78
export default (await resolveConfig("lint-staged"))?.config ?? defaultConfig;
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// @ts-check
22
import path from "node:path";
3+
import process from "node:process";
34
import { dir, resolveConfig } from "../utils.js";
45

56
const cliPath = path.resolve(dir(import.meta.url), "..", "bin", "fenge.cli.js");
6-
const defaultConfig = { "*": [`${cliPath} -w`] };
7+
const defaultConfig = { "*": [`${process.execPath} ${cliPath} -w`] };
78
export default (await resolveConfig("lint-staged"))?.config ?? defaultConfig;

0 commit comments

Comments
 (0)