diff options
| author | Bobby <[email protected]> | 2022-06-28 03:36:12 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-06-28 03:36:12 +0530 |
| commit | be382e516e9f0e4c46b7015c18e6d4e232ae6be4 (patch) | |
| tree | 34e04a19fc4c229bcd14b5d18f31292db96ef1d5 /hooks/pre-commit.js | |
| parent | d91bfefe7c1f917db8e669b7191a6705ac102102 (diff) | |
| download | thatcomputerscientist-be382e516e9f0e4c46b7015c18e6d4e232ae6be4.tar.xz thatcomputerscientist-be382e516e9f0e4c46b7015c18e6d4e232ae6be4.zip | |
Modifying Readme before commit
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); + + |
