diff options
| author | Bobby <[email protected]> | 2022-06-28 03:27:32 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-06-28 03:27:32 +0530 |
| commit | 81e03df3a9768c854c78905725e809fdc3f540ea (patch) | |
| tree | 37f4e5cb344ac6af47126a10f9eb5c6c07d978fd /hooks/pre-commit.js | |
| parent | 60560011ce5cc3322d8eadb33033df6ed4b87c03 (diff) | |
| download | thatcomputerscientist-81e03df3a9768c854c78905725e809fdc3f540ea.tar.xz thatcomputerscientist-81e03df3a9768c854c78905725e809fdc3f540ea.zip | |
Added hook for modifying readme
Diffstat (limited to 'hooks/pre-commit.js')
| -rw-r--r-- | hooks/pre-commit.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hooks/pre-commit.js b/hooks/pre-commit.js new file mode 100644 index 00000000..c1b2cca0 --- /dev/null +++ b/hooks/pre-commit.js @@ -0,0 +1,11 @@ +const fs = require("fs"); + +// Open the readme file +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); |
