blob: d917d59a7f55b69ddf2b9cd5b5a39d3cb70fbed6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
const fs = require("fs");
const shell = require("shelljs");
// 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]"));
// 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);
// Add the readme file to the git commit
shell.exec("git add README.md");
|