Skip to content

Commit f6aaab1

Browse files
committed
Ensure example image resources are available
Re-try commit
1 parent 69c743b commit f6aaab1

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ htmlcov/
3131

3232
docs/source/_static/jupyter-threejs.js
3333
docs/source/_static/three.js
34+
docs/source/examples/img
3435

3536
js/lab-dist

js/scripts/copy-files.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ const staticDir = path.resolve(baseDir, '..', 'pythreejs', 'static');
1212
const buildDir = path.resolve(baseDir, 'dist');
1313
const docStaticDir = path.resolve(baseDir, '..', 'docs', 'source', '_static');
1414

15+
const exampleImagesSrcDir = path.resolve(baseDir, '..', 'examples', 'img');
16+
const exampleImagesDstDir = path.resolve(docStaticDir, 'examples', 'img');
17+
1518

1619
function copyThree() {
1720
return fse.copy(
@@ -31,10 +34,25 @@ function copyBundleToDocs() {
3134
});
3235
}
3336

37+
function copyExampleImagesToDocs() {
38+
return fse.readdir(exampleImagesSrcDir).then((dirFiles) => {
39+
return Promise.all(dirFiles.map(filePath => {
40+
return fse.copy(
41+
path.resolve(exampleImagesSrcDir, filePath),
42+
path.resolve(exampleImagesDstDir, filePath)
43+
).then(function() {
44+
console.log(`Copied ${filePath} to docs examples' image folder`);
45+
});
46+
}));
47+
});
48+
}
49+
50+
3451
if (require.main === module) {
3552
// This script copies files after a build
3653
Promise.all([
3754
copyThree(),
3855
copyBundleToDocs(),
56+
copyExampleImagesToDocs(),
3957
]);
4058
}

0 commit comments

Comments
 (0)