#!/bin/bash

ECHOPREFIX=" => "
NULLPREFIX="    "

echo -e "=> Hello, this is \033[31mtexbox\033[0m"

if test "$(ls -A /tex)"; then
    # Directory not empty - user mounted directory \o/
    if [ -z "$TARGET" ]; then
        # target unset.
        TARGET="*.tex"
    fi

    # Build the PDF
    texi2pdf $TARGET
else
    # Directory is empty
    echo "=> Please mount your directory to /tex"
    echo "   See you soon."
fi

