29 lines
		
	
	
	
		
			592 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			592 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
#!/bin/sh
 | 
						||
echo "$1" | grep -E 'datapackage|glb$' || exit 0 # nothing to do
 | 
						||
dir=$(dirname $1)
 | 
						||
cd "$dir"
 | 
						||
echo "[package_janusxr.sh] packing janusxr.html"
 | 
						||
 | 
						||
glb=$(ls *.glb | head -n1) # todo: check datapackage.json instead of first match
 | 
						||
 | 
						||
jml='
 | 
						||
<html>
 | 
						||
<head>
 | 
						||
  <title>janusxr room</title>
 | 
						||
</head>
 | 
						||
<body>
 | 
						||
  <script src="https://web.janusvr.com/janusweb.js"></script>
 | 
						||
  <janus-viewer>
 | 
						||
 | 
						||
    <FireBoxRoom>
 | 
						||
     <Room>
 | 
						||
       <Object id="experience" src="'$glb'" locked="true" pos="0 0 0"></Object> 
 | 
						||
     </Room>
 | 
						||
    </FireBoxRoom>
 | 
						||
 | 
						||
  </janus-viewer>
 | 
						||
</body>
 | 
						||
</html>
 | 
						||
'
 | 
						||
 | 
						||
echo "$jml" > janusxr.html
 |