lint-staged 12.0.0 → 12.0.1
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/bin/lint-staged.js +4 -1
- package/package.json +1 -1
package/bin/lint-staged.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import fs from 'fs'
|
|
4
|
+
import path from 'path'
|
|
5
|
+
import { fileURLToPath } from 'url'
|
|
4
6
|
|
|
5
7
|
import cmdline from 'commander'
|
|
6
8
|
import debug from 'debug'
|
|
@@ -17,7 +19,8 @@ if (supportsColor.stdout) {
|
|
|
17
19
|
// Do not terminate main Listr process on SIGINT
|
|
18
20
|
process.on('SIGINT', () => {})
|
|
19
21
|
|
|
20
|
-
const
|
|
22
|
+
const packageJsonPath = path.join(fileURLToPath(import.meta.url), '../../package.json')
|
|
23
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath))
|
|
21
24
|
const version = packageJson.version
|
|
22
25
|
|
|
23
26
|
cmdline
|