xrsh-buildroot/buildroot-v86/board/v86/rootfs_overlay/root/bin/a-gltf-model

12 lines
301 B
Bash
Executable File

#!/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'></a-gltf-model>" >> /root/index.html