diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-08-20 20:44:34 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-08-20 20:44:34 -0300 |
commit | e851401694daacaf1aba2c87ed557e5dbf00af02 (patch) | |
tree | d772b15f3a5ba9e015936f7162f448a7208a4001 /collector | |
parent | d6a4d78d31ffa57e00a7d5b0a87baa38156cee06 (diff) | |
download | scripts-e851401694daacaf1aba2c87ed557e5dbf00af02.tar.gz scripts-e851401694daacaf1aba2c87ed557e5dbf00af02.tar.bz2 |
Move scripts to other repositories
Diffstat (limited to 'collector')
-rwxr-xr-x | collector | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/collector b/collector deleted file mode 100755 index 387cb02..0000000 --- a/collector +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash -# -# Collector: add, view, edit a collector file (from GTD/ZTD methodologies). -# -# The collector file is a Markdown file with the Task list extension, such as -# https://docs.gitlab.com/ee/user/markdown.html#task-lists -# - -# Parameters -BASENAME="`basename $0`" -ACTION="$1" -COLLECTOR_NAME="`echo $COLLECTOR_FILE | sed -e "s|$HOME|~|"`" - -# Check -if [ -z "$COLLECTOR_FILE" ]; then - # Do not be verbose here, otherwise the "status" command will show an error - # message on unconfgirued systems. Maybe that should be controlled by a verbosity flag. - #echo "$BASENAME: please export the COLLECTOR_FILE environment variable pointing to your collector markdown file" - - exit 1 -elif [ ! -e "$COLLECTOR_FILE" ]; then - echo "$BASENAME: error: file not found: $COLLECTOR_FILE" - exit 1 -fi - -# Dispatch -if [ -z "$ACTION" ] || [ "$ACTION" == "view" ]; then - cat "$COLLECTOR_FILE" -elif [ "$ACTION" == "add" ]; then - shift - echo "* $*" >> "$COLLECTOR_FILE" -elif [ "$ACTION" == "list" ]; then - if grep -q -e "^ *\* " "$COLLECTOR_FILE"; then - echo "Collected items at $COLLECTOR_NAME:" - echo "" - grep -e "^ *\* " "$COLLECTOR_FILE" - echo "" - fi -elif [ "$ACTION" == "count" ]; then - if grep -q -e "^ *\* " "$COLLECTOR_FILE"; then - COUNT="`grep -e "^ *\* " "$COLLECTOR_FILE" | wc -l`" - echo "$COUNT collected items at $COLLECTOR_NAME" - echo "" - fi -elif [ "$ACTION" == "edit" ]; then - if [ ! -z "$EDITOR" ]; then - $EDITOR "$COLLECTOR_FILE" - else - echo "$BASENAME: error: please export the EDITOR environment variable pointing to your editor of choice" - exit 1 - fi -fi |