From 71509c4d7fc4042754af746fddd5d292df7a6e82 Mon Sep 17 00:00:00 2001 From: huanghai Date: Fri, 26 Apr 2019 21:57:45 +0800 Subject: [PATCH 1/2] fix: modify the parameters for the sander.readFile function (#448) --- @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..63594ac664 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'); } From 5fb8f526fdb21607a38d294f1dfcf356988480b9 Mon Sep 17 00:00:00 2001 From: huanghai4 Date: Sun, 28 Apr 2019 13:23:26 +0800 Subject: [PATCH 2/2] 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 63594ac664..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, { encoding: 'utf-8' }); + const gitFile = await sander.readFile(dotgitPath, {encoding: 'utf-8'}); const relativeGitPath = gitFile.replace('gitdir: ', '').replace('\n', ''); editFilePath = path.resolve(top, relativeGitPath, 'COMMIT_EDITMSG'); }