summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2018-03-29 17:52:12 -0500
committerepoch <epoch@hacking.allowed.org>2018-03-29 17:52:12 -0500
commit67dedb98f82b7ba2c78afd49e81a0650dab796a9 (patch)
treeca0c1e58e16df57d24392c1e041c8cd7c1a93656
parent4267148da482fe00413e38ee785cd7e012531d78 (diff)
downloadhackvr-67dedb98f82b7ba2c78afd49e81a0650dab796a9.tar.gz
hackvr-67dedb98f82b7ba2c78afd49e81a0650dab796a9.zip
made makelabel.sh more likely to catch errors before they get passed out into other places.
-rwxr-xr-xmakelabel.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/makelabel.sh b/makelabel.sh
index dbc984e..e787c49 100755
--- a/makelabel.sh
+++ b/makelabel.sh
@@ -1,14 +1,27 @@
#!/bin/bash
target="$1"
+if grep ' ' <<<$1;then
+ echo 'fuck. no spaces in $1.'
+ exit 1
+fi
+##target should not have any spaces or else it fucks shit up. >_>... oh well. hex encode it.
xoffset=$2
yoffset=$3
zoffset=$4
+if [ "_" = "_$xoffset" -o "_" = "_$yoffset" -o "_" = "_$zoffset" ];then
+ echo "missing an offset argument! wtf?" >&2
+ exit 1
+fi
while read -rN 1 c;do
name="$(printf "%02x" "'$c")"
if [ "$name" = "0a" ]; then
xoffset=-6
yoffset="$(printf '%d - %d\n' $yoffset 10 | bc)"
fi
- grep "^$name " font/font.hackvr | sed 's ^'"$name"' '"$target"' ' | ./tools/offsetshape.sh "$xoffset" "$yoffset" "$zoffset"
+ if grep "^$name " font/font.hackvr 2>&1 > /dev/null;then #don't do this shit unless we actually have something to draw. awk in offsetshape bitches when there's nothing.
+ grep "^$name " font/font.hackvr \
+ | sed 's/^'"$name"'/'"$target"'/' \
+ | ./tools/offsetshape.sh "$xoffset" "$yoffset" "$zoffset"
+ fi
xoffset="$(printf '%d + %d\n' $xoffset 6 | bc)"
done