diff options
Diffstat (limited to 'hooks/pre-commit.js')
| -rw-r--r-- | hooks/pre-commit.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/hooks/pre-commit.js b/hooks/pre-commit.js index c1b2cca0..c4d3ff7c 100644 --- a/hooks/pre-commit.js +++ b/hooks/pre-commit.js @@ -5,7 +5,12 @@ const readme = fs.readFileSync("README.md", "utf8"); // Find the line which starts with "![Screenshot]" const screenshotLine = readme.split("\n").find(line => line.startsWith("![Screenshot]")); -screenshotLine.replace("![Screenshot]", `})`); -// Write the new line to the readme file -fs.writeFileSync("README.md", readme); +// Replace the line with the new screenshot +const newScreenshotLine = `})`; +const newReadme = readme.replace(screenshotLine, newScreenshotLine); + +// Write the new readme file +fs.writeFileSync("README.md", newReadme); + + |
