From 04fcb536542e9fee362c58ffa8c8ab5b7077c5d6 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Mon, 15 Jan 2018 09:37:31 +0000 Subject: [PATCH] fix: use read and write instead of copy --- bin/install.js | 5 +++-- {bin => hooks}/commit-msg | 0 2 files changed, 3 insertions(+), 2 deletions(-) rename {bin => hooks}/commit-msg (100%) 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