fixed a-gltf-model..works via hasharg now

This commit is contained in:
Leon van Kammen 2025-01-06 15:57:57 +01:00
parent 206a6362b1
commit 986c40a50f
1 changed files with 7 additions and 3 deletions

View File

@ -1,7 +1,11 @@
#!/bin/sh
test -n "$1" || { echo "usage: a-gltf-model <gltf-file>"; exit; }
file="$1"
echo "$file" | grep -q http || {
file="$(readlink -f "$1")"
file="${file#/}" # strip leading slash if present
file="file://xrsh/$file"
}
echo "<a-gltf-model src='file://xrsh/$file'></a-gltf-model>" >> /root/index.html
echo "<a-gltf-model src='$file'></a-gltf-model>" >> /root/index.html