diff --git a/bin/install.js b/bin/install.js index 7f5247874..de9a4011e 100644 --- a/bin/install.js +++ b/bin/install.js @@ -3,9 +3,10 @@ const utils = require('../src/utils') const exists = require('fs').existsSync -const copy = require('fs').copyFileSync const rename = require('fs').renameSync const join = require('path').join +const read = require('fs').readFileSync +const write = require('fs').writeFileSync const hooksDir = utils.getPathToHooks() const hook = join(hooksDir, 'commit-msg') @@ -15,4 +16,4 @@ if (exists(hook)) { rename(hook, join(hooksDir, 'commit-msg.bak')) } -copy(join(__dirname, 'commit-msg'), hook) +write(read(join(__dirname, '..', 'hooks', 'commit-msg')), hook) diff --git a/bin/commit-msg b/hooks/commit-msg similarity index 100% rename from bin/commit-msg rename to hooks/commit-msg