You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
809 B
26 lines
809 B
2 years ago
|
#!/bin/bash
|
||
|
FILE=offline.html
|
||
|
AFRAME=aframe-local.min.js
|
||
|
if [ ! -f "$AFRAME" ]; then
|
||
|
echo "$AFRAME does not exist. Make sure to run get-local-aframe first"
|
||
|
exit
|
||
|
fi
|
||
|
|
||
|
git clone --depth 1 https://github.com/networked-aframe/networked-aframe
|
||
|
cd networked-aframe/
|
||
|
cp package-glitch.json package.json
|
||
|
npm i
|
||
|
cd examples/
|
||
|
mkdir offline
|
||
|
cd offline/
|
||
|
wget $(grep 'script src="https' ../basic.html | grep -v aframe.min.js | sed "s/.*\(https.*\)\".*/\1/")
|
||
|
cd ..
|
||
|
cp -r ../../$AFRAME ../../local-fonts ../../local-models offline/
|
||
|
cp basic.html $FILE
|
||
|
sed "s/https.*aframe.min.js/offline\/aframe-local.min.js/" -i $FILE
|
||
|
sed "s/script src=\"https:.*[^<]\//script src=\"offline\//" -i $FILE
|
||
|
cd ..
|
||
|
|
||
|
echo "to test run : cd networked-aframe && node server/easyrtc-server.js"
|
||
|
echo "then visit http://localhost:8080/$FILE"
|