Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
HARP-6703 Fix copying across images (#1666)
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Stichbury <2533428+nzjony@users.noreply.github.com>
  • Loading branch information
nzjony committed Jul 7, 2020
1 parent fb8af7c commit 692bf14
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions scripts/setup-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,33 @@ function copyLandingPageFiles() {
fse.copySync(path.join(sdkDir, "docs"), distDocsOutDir);
}

function copyImages() {
// tslint:disable-next-line:no-console
console.log("Copy across images...");

const inputExts = [".svg", ".gif", ".png"];
const mediaOutDir = path.resolve(sdkDir, "dist/media");

for (const inputExt of inputExts) {
const sourceFiles = glob.sync(sdkDir + `/{docs,coresdk/docs}/@docs/**/*${inputExt}`);
// tslint:disable-next-line:no-console
console.log("source files with ext: " + inputExt);
// tslint:disable-next-line:no-console
console.log(sourceFiles);

for (const sourceFile of sourceFiles) {
const outSubDir = path.join(mediaOutDir, path.basename(path.dirname(sourceFile)));
mkpath.sync(outSubDir);
const outFile = path.resolve(outSubDir, path.basename(sourceFile));
const cmd = `cp ${sourceFile} ${outFile}`;
// tslint:disable-next-line:no-console
console.log(cmd);
execSync(cmd);
}
}
}

extractCodeSnippets();
renderDiagrams();
copyLandingPageFiles();
copyImages();

0 comments on commit 692bf14

Please sign in to comment.