Skip to content

Commit

Permalink
fix deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
elalish committed Jul 31, 2023
1 parent 432c2e1 commit f59d21e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/modelviewer.dev/scripts/ci-before-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,30 @@ mkdir -p $DEPLOY_ROOT/fidelity
mkdir -p $DEPLOY_ROOT/editor
mkdir -p $DEPLOY_ROOT/editor/view
mkdir -p $DEPLOY_ROOT/dist
mkdir -p $DEPLOY_ROOT/node_modules
mkdir -p $DEPLOY_ROOT/node_modules/@google
mkdir -p $DEPLOY_ROOT/node_modules/@google/model-viewer
mkdir -p $DEPLOY_ROOT/node_modules/@google/model-viewer/dist

mv ../render-fidelity-tools/test/results $DEPLOY_ROOT/fidelity/results
cp ../render-fidelity-tools/test/results-viewer.html $DEPLOY_ROOT/fidelity/index.html
cp ../render-fidelity-tools/dist/* $DEPLOY_ROOT/dist/
cp ../space-opera/editor/index.html $DEPLOY_ROOT/editor/
cp ../space-opera/editor/view/index.html $DEPLOY_ROOT/editor/view/
cp ../space-opera/dist/space-opera.js $DEPLOY_ROOT/dist/
cp ../model-viewer/dist/* $DEPLOY_ROOT/dist/
cp ../model-viewer-effects/dist/* $DEPLOY_ROOT/dist/
cp ../model-viewer/dist/* $DEPLOY_ROOT/node_modules/@google/model-viewer/dist/
cp ../model-viewer-effects/dist/* $DEPLOY_ROOT/node_modules/@google/model-viewer/dist/

FILES_TO_PATCH_WITH_MINIFIED_BUNDLE=($(find $DEPLOY_ROOT \( -type d -name node_modules -prune \) -o -type f | grep \.html))

for file_to_patch in "${FILES_TO_PATCH_WITH_MINIFIED_BUNDLE[@]}"; do
sed -i.bak 's/model-viewer\.js/model-viewer\.min\.js/g' $file_to_patch
sed -i.bak 's ../../node_modules/@google/model-viewer/dist/model-viewer.js dist/model-viewer.min.js g' $file_to_patch
rm $file_to_patch.bak
sed -i.bak 's ../../node_modules/@google/model-viewer/dist/model-viewer-module.js dist/model-viewer-module.min.js g' $file_to_patch
rm $file_to_patch.bak
sed -i.bak 's ../../node_modules/@google/model-viewer-effects/dist/model-viewer-effects.js dist/model-viewer-effects.min.js g' $file_to_patch
rm $file_to_patch.bak
done

Expand Down

0 comments on commit f59d21e

Please sign in to comment.