From dc226217e1dd05d2b66630175d3317db872ea092 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 15 Feb 2016 17:05:18 +1300 Subject: Safety check for td(1) --- bin/td | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/td b/bin/td index 1c8828d2..80542979 100755 --- a/bin/td +++ b/bin/td @@ -16,6 +16,9 @@ path=${TODO:-$HOME/Todo/todo.markdown} file=${path##*/} dir=${path%/*} +# Check we've got the tools we need +hash git || exit + # If the directory doesn't exist, create it if [[ ! -d $dir ]] ; then mkdir -p -- "$dir" || exit -- cgit v1.2.3