diff --git a/import-tabletsmd.sh b/import-tabletsmd.sh new file mode 100755 index 0000000..fefd275 --- /dev/null +++ b/import-tabletsmd.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +BASEDIR="$(dirname "$0")" +TABLETS_MD_LOC="${TABLETS_MD_LOC:="${BASEDIR}/../opentabletdriver/TABLETS.md"}" + +if [ -z "$TABLETS_MD_LOC" ]; then + for reponame in opentabletdriver OpenTabletDriver; do + tmp="${reponame}"/TABLETS.md + + if [ -f "$tmp" ]; then + TABLETS_MD_LOC="$tmp" + break + fi + done +fi + +if [ -z "$TABLETS_MD_LOC" ] || [ ! -f "$TABLETS_MD_LOC" ]; then + echo "Can't find TABLETS.md, bailing" + exit 1 +fi + +cp -i "$TABLETS_MD_LOC" "${BASEDIR}"/site/_includes/tablets.md || exit $?