Skip to content

Commit 3211c29

Browse files
authored
🐛 Fix commit hook creation on Windows (#61)
Fixes #58
1 parent f368117 commit 3211c29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gitmoji.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class GitmojiCli {
3636
}
3737

3838
fs.writeFile(
39-
process.env.PWD + constants.HOOK_PATH, constants.HOOK_FILE_CONTENTS,
39+
process.cwd() + constants.HOOK_PATH, constants.HOOK_FILE_CONTENTS,
4040
{ mode: constants.HOOK_PERMISSIONS },
4141
(err) => {
4242
if (err) this._errorMessage(err)
@@ -52,7 +52,7 @@ class GitmojiCli {
5252
return this._errorMessage('Couldn\'t remove hook, not a git repository')
5353
}
5454

55-
fs.unlink(process.env.PWD + constants.HOOK_PATH, (err) => {
55+
fs.unlink(process.cwd() + constants.HOOK_PATH, (err) => {
5656
if (err) return this._errorMessage(err)
5757
return console.log(
5858
`${chalk.yellow('gitmoji')} commit hook unlinked successfully.`

0 commit comments

Comments
 (0)