Browse Source

using better git check

master
Ben Savage 5 years ago
parent
commit
f5234cba17
  1. 10
      cl

10
cl

@ -25,7 +25,11 @@ $0 - Captain's log
Create a file in "$CLDIR" called "template" with the base text to add to each day
and the task will be appended to the file when it is accessed through $0
If the file is not executable, it is treated as a static template and is copied each day.
The string {{DATE}} can be used to insert a date string. {{DATE <date-compatible format>}} can be used to replace the defualt format.
i.e {{DATE %F}} fill produce the text $(date %F).
If the file is executable, it will be run in the context of the user, and the output will be used instead.
Directories created under $BASEDIR are treated as profiles (if they exist). The default profile is assumed to be 'default'.
Specify -p <profile> as the first argument to $0 to operate on a different one
@ -45,6 +49,8 @@ $0 - Captain's log
; is a general note possibly worth reviewing
# is for a verbose note, probably not of general interest but was worth noting
If $CLDIR is a git repo (git rev-parse returns 0), it will be updated and auto committed unless --no-git is passed
EOF
}
@ -121,7 +127,7 @@ function captains_log() {
TODAY=$(date +%F)
TOMORROW=$(date +%F -d "+${modT:-1} day")
if [ ${GIT:-1} ] && [ -d "$CLDIR/.git" ]; then
if [ ${GIT:-1} ] && (git -C $CLDIR rev-parse 2>/dev/null) ; then
GIT=1
else
GIT=0

Loading…
Cancel
Save