Skip to content

Instantly share code, notes, and snippets.

@rotten77
Last active August 29, 2015 14:07
Show Gist options
  • Save rotten77/66d2b9b566bf32129754 to your computer and use it in GitHub Desktop.
Save rotten77/66d2b9b566bf32129754 to your computer and use it in GitHub Desktop.
ToDone (Sublime Text plugin) - Check *.todo files in folder and make a list of uncompletted tasks
#!/bin/bash
# https://sublime.wbond.net/packages/ToDone
# Check *.todo files in folder and make a list of uncompletted tasks
for f in *.todo
do
hasTasks=false
projectName="To do list"
projectTasks=""
IFS=''
while read line; do
if [[ $line != "" ]]; then
if [[ $line =~ ^[0-9a-zA-Z] ]]; then
projectName=$line
fi
if [[ $line =~ ^[-!] ]]; then
hasTasks=true
projectTasks="$projectTasks\n $projectName: ${line:0:50}"
fi
fi
done < $f
if [[ $hasTasks == true ]]; then
printf "== $f ==\n$projectTasks\n\n"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment