Skip to content

Commit 392e4e5

Browse files
authored
fix: 🐛 Cannot find module '../package.json' (#23)
* fix: 🐛 Cannot find module '../package.json' Fixes #22 * 0.7.2 * 0.7.3
1 parent 2e11368 commit 392e4e5

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

bin/pre-push.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*
1111
*/
1212
import shell from 'shelljs'
13+
import path from 'path'
1314

1415
const NO_HOOK_VAR = 'NO_HOOK'
1516
const INNER_PRE_HOOK = 'CHATIE_INNER_PRE_HOOK'
@@ -55,7 +56,8 @@ if (refs?.[0]?.localCommit.match(/^0+$/)) {
5556
process.exit(0)
5657
}
5758

58-
const packageVersion = require('../package.json').version
59+
const pkgFile = path.join(process.cwd(), 'package.json')
60+
const packageVersion = require(pkgFile).version
5961
const lastCommitMsg = shell.exec('git log --pretty=format:"%s" HEAD^0 -1', { silent : true }).stdout
6062

6163
if (packageVersion === lastCommitMsg) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@chatie/git-scripts",
3-
"version": "0.7.1",
3+
"version": "0.7.3",
44
"description": "Git Hooks Integration for Chatie Projects",
55
"directories": {
66
"doc": "docs",

0 commit comments

Comments
 (0)