From 3211c29d9f3747fc052bc984a8eb8507c4067903 Mon Sep 17 00:00:00 2001 From: Carlos Cuesta Date: Sun, 6 Aug 2017 23:39:59 +0200 Subject: [PATCH] :bug: Fix commit hook creation on Windows (#61) Fixes #58 --- src/gitmoji.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gitmoji.js b/src/gitmoji.js index 2ed688a09..1b2f1af47 100644 --- a/src/gitmoji.js +++ b/src/gitmoji.js @@ -36,7 +36,7 @@ class GitmojiCli { } fs.writeFile( - process.env.PWD + constants.HOOK_PATH, constants.HOOK_FILE_CONTENTS, + process.cwd() + constants.HOOK_PATH, constants.HOOK_FILE_CONTENTS, { mode: constants.HOOK_PERMISSIONS }, (err) => { if (err) this._errorMessage(err) @@ -52,7 +52,7 @@ class GitmojiCli { return this._errorMessage('Couldn\'t remove hook, not a git repository') } - fs.unlink(process.env.PWD + constants.HOOK_PATH, (err) => { + fs.unlink(process.cwd() + constants.HOOK_PATH, (err) => { if (err) return this._errorMessage(err) return console.log( `${chalk.yellow('gitmoji')} commit hook unlinked successfully.`