diff --git a/scripts/deploy.js b/scripts/deploy.js index 5fde259a00cac0e03fe680410768fabd5d42dc0d..652a2abd72de7212ee98f328c57c223de56d27e4 100644 --- a/scripts/deploy.js +++ b/scripts/deploy.js @@ -1,5 +1,5 @@ /** - * Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info. + * Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> */ @@ -39,6 +39,24 @@ function copyViewer() { addAnalytics(path.resolve(viewerDeployPath, 'index.html')); } +function copyDemos() { + console.log('\n###', 'copy demos files'); + const lightingBuildPath = path.resolve(buildDir, '../build/examples/lighting/'); + const lightingDeployPath = path.resolve(localPath, 'demos/lighting/'); + fse.copySync(lightingBuildPath, lightingDeployPath, { overwrite: true }); + addAnalytics(path.resolve(lightingDeployPath, 'index.html')); + + const orbitalsBuildPath = path.resolve(buildDir, '../build/examples/alpha-orbitals/'); + const orbitalsDeployPath = path.resolve(localPath, 'demos/alpha-orbitals/'); + fse.copySync(orbitalsBuildPath, orbitalsDeployPath, { overwrite: true }); + addAnalytics(path.resolve(orbitalsDeployPath, 'index.html')); +} + +function copyFiles() { + copyViewer(); + copyDemos(); +} + if (!fs.existsSync(localPath)) { console.log('\n###', 'create localPath'); fs.mkdirSync(localPath, { recursive: true }); @@ -52,9 +70,9 @@ if (!fs.existsSync(path.resolve(localPath, '.git/'))) { .outputHandler(log) .clone(remoteUrl, localPath) .fetch(['--all']) - .exec(copyViewer) + .exec(copyFiles) .add(['-A']) - .commit('updated viewer') + .commit('updated viewer & demos') .push(); } else { console.log('\n###', 'update repository'); @@ -62,8 +80,8 @@ if (!fs.existsSync(path.resolve(localPath, '.git/'))) { .outputHandler(log) .fetch(['--all']) .reset(['--hard', 'origin/master']) - .exec(copyViewer) + .exec(copyFiles) .add(['-A']) - .commit('updated viewer') + .commit('updated viewer & demos') .push(); } \ No newline at end of file diff --git a/src/examples/alpha-orbitals/index.html b/src/examples/alpha-orbitals/index.html index 57d0b90e016cf4c52c07d2007ca8dd15eef76c12..ee7cb754b9ab10985daf29bde749f852b056ba95 100644 --- a/src/examples/alpha-orbitals/index.html +++ b/src/examples/alpha-orbitals/index.html @@ -57,5 +57,6 @@ <script> AlphaOrbitalsExample.init('app') </script> + <!-- __MOLSTAR_ANALYTICS__ --> </body> </html> \ No newline at end of file diff --git a/src/examples/lighting/index.html b/src/examples/lighting/index.html index 2be99e14ef3dfcbcf8550b41ec3f4d570aa86d67..c96606aa9048e9340caddcceb7720db54dcd68e7 100644 --- a/src/examples/lighting/index.html +++ b/src/examples/lighting/index.html @@ -84,5 +84,6 @@ $('controls').appendChild(h); } </script> + <!-- __MOLSTAR_ANALYTICS__ --> </body> </html> \ No newline at end of file