From 1f4277c174a6bc7ac938430d2260b01643e4bc67 Mon Sep 17 00:00:00 2001 From: Pelle Wessman Date: Sat, 10 Aug 2019 11:03:56 +0200 Subject: [PATCH 1/2] Fix check for empty diff Compare to the result of the latest diff module: https://runkit.com/embed/y4qzdzzz05qr No diff gives this result: ``` Index: =================================================================== --- +++ ``` --- src/commands/readme.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/readme.js b/src/commands/readme.js index 11e81d351..535c854b6 100644 --- a/src/commands/readme.js +++ b/src/commands/readme.js @@ -101,7 +101,7 @@ module.exports.handler = function readme(argv) { '', '' ); - if (!diffRaw.length) { + if (diffRaw.length === 4) { log(`${argv.readmeFile} is up to date.`); process.exit(0); } From 139cd91dbf090ac695753c452eba556439ee8f6d Mon Sep 17 00:00:00 2001 From: Pelle Wessman Date: Sat, 10 Aug 2019 11:10:02 +0200 Subject: [PATCH 2/2] Actually check the right thing in the fix as well --- src/commands/readme.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/readme.js b/src/commands/readme.js index 535c854b6..00813c63c 100644 --- a/src/commands/readme.js +++ b/src/commands/readme.js @@ -101,7 +101,7 @@ module.exports.handler = function readme(argv) { '', '' ); - if (diffRaw.length === 4) { + if (diffRaw.split('\n').length === 5) { log(`${argv.readmeFile} is up to date.`); process.exit(0); }