Skip to content

Commit

Permalink
fix(docs): make sure image files are copied with README.md
Browse files Browse the repository at this point in the history
Signed-off-by: Raymond Feng <[email protected]>
  • Loading branch information
raymondfeng committed Sep 3, 2020
1 parent c8bdfda commit ed9c5ef
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions docs/bin/copy-readmes.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,20 @@ async function copyReadmes() {
}));

for (const {location} of packages) {
const src = path.join(REPO_ROOT, location, 'README.md');
const dest = path.join(DEST_ROOT, location, 'README.md');
await fs.copy(src, dest, {overwrite: true});
let files = await fs.readdir(path.join(REPO_ROOT, location));
files = files.filter(
// Copy README.md and image files
f =>
f === 'README.md' ||
['.png', '.jpg', 'jpeg'].includes(path.extname(f).toLowerCase()),
);
for (const f of files) {
await fs.copy(
path.join(REPO_ROOT, location, f),
path.join(DEST_ROOT, location, f),
{overwrite: true},
);
}
}
}

Expand Down

0 comments on commit ed9c5ef

Please sign in to comment.