-
-
Notifications
You must be signed in to change notification settings - Fork 145
Expand file tree
/
Copy pathcopy-readme.js
More file actions
19 lines (19 loc) · 744 Bytes
/
copy-readme.js
File metadata and controls
19 lines (19 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const fs = require("fs-extra");
const path = require("path");
const autoGeneratedMessage = `<!-- NOTE!!! This markdown file is automatically generated from <root>/README.md, please edit <root>/README.md if you need to change it-->`;
async function main() {
const from = path.resolve(__dirname, "../README.md");
const toPackage = path.resolve(
__dirname,
"../packages/actionsflow/README.md"
);
const content = await fs.readFileSync(from, "utf-8");
const finalContent = autoGeneratedMessage + "\n\n" + content;
await fs.writeFile(toPackage, finalContent);
// eslint-disable-next-line no-console
console.log("sync readme file successfully");
// add <!-- auto generate -->
}
main().catch((e) => {
console.error(e);
});