diff options
| author | Bobby <[email protected]> | 2022-06-28 03:38:36 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-06-28 03:38:36 +0530 |
| commit | b2456ac2dcec0c5702490612a90bc3803546c57a (patch) | |
| tree | 07dd65c126021ec3bf0243ccdde946bcc12c04cb /hooks/pre-commit.js | |
| parent | be382e516e9f0e4c46b7015c18e6d4e232ae6be4 (diff) | |
| download | thatcomputerscientist-b2456ac2dcec0c5702490612a90bc3803546c57a.tar.xz thatcomputerscientist-b2456ac2dcec0c5702490612a90bc3803546c57a.zip | |
Auto add readme to git when committing
Diffstat (limited to 'hooks/pre-commit.js')
| -rw-r--r-- | hooks/pre-commit.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hooks/pre-commit.js b/hooks/pre-commit.js index c4d3ff7c..485fc424 100644 --- a/hooks/pre-commit.js +++ b/hooks/pre-commit.js @@ -1,4 +1,5 @@ const fs = require("fs"); +const shell = require("shelljs"); // Open the readme file const readme = fs.readFileSync("README.md", "utf8"); @@ -13,4 +14,6 @@ const newReadme = readme.replace(screenshotLine, newScreenshotLine); // Write the new readme file fs.writeFileSync("README.md", newReadme); - +// Add the readme file to the git commit +shell.exec("git add README.md"); +shell.exec("git commit -m 'Auto Update Readme'"); |
