From 8e47985806c9cebdde9e2a5e8919dc98d7c4b235 Mon Sep 17 00:00:00 2001 From: huanghai21 Date: Fri, 3 May 2019 03:00:03 +0800 Subject: [PATCH] fix: use sander.readFile correctly (#448) (#630) * fix: modify the parameters for the sander.readFile function (#448) * fix: modify the parameters for the sander.readFile function (#448) - prettier lint fix --- @commitlint/read/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/@commitlint/read/src/index.js b/@commitlint/read/src/index.js index 9323a34a48..b9ae72e0b4 100644 --- a/@commitlint/read/src/index.js +++ b/@commitlint/read/src/index.js @@ -59,7 +59,7 @@ async function getEditFilePath(top, edit) { if (dotgitStats.isDirectory()) { editFilePath = path.join(top, '.git/COMMIT_EDITMSG'); } else { - const gitFile = await sander.readFile(dotgitPath, 'utf8'); + const gitFile = await sander.readFile(dotgitPath, {encoding: 'utf-8'}); const relativeGitPath = gitFile.replace('gitdir: ', '').replace('\n', ''); editFilePath = path.resolve(top, relativeGitPath, 'COMMIT_EDITMSG'); }