removed the 'function' keyword before declaring a function as is not needed.
[bash-notes.git] / SOURCE / head.sh
index 6278aa1..7b684f1 100644 (file)
@@ -17,7 +17,7 @@ PID=$$
 BASENAME=$( basename "$0" )
 NOW=$(date +%s)
 
-VERSION="0.3"
+VERSION="0.4git"
 DBVERSION=${VERSION}_${NOW}
 
 set_defaults() {
@@ -25,6 +25,8 @@ set_defaults() {
 JQ=${JQ:-/usr/bin/jq}
 EDITOR=${EDITOR:-/usr/bin/vim}
 TERMINAL=${TERMINAL:-/usr/bin/alacritty}
+# Git binary only used if $USEGIT is true - See below
+GIT=${GIT:-/usr/bin/git}
 # add options for your terminal. Remember to add the last option to execute
 # your editor program, otherwise the script will fail.
 # see example in the addnote function
@@ -43,6 +45,13 @@ DB=${BASEDIR}/db.json
 # directory containing the actual notes
 NOTESDIR=${BASEDIR}/notes
 
+### GIT SUPPORT
+
+# If you want to store your notes in a git repository set this to true
+USEGIT=true
+# Address of your remote repository
+GITREMOTE=${GITREMOTE:-""}
+
 } # end set_defaults, do not change this line.
 
 set_defaults
@@ -82,7 +91,7 @@ fi
 echo $PID > "$PIDFILE"
 
 # Export config to file
-function export_config() {
+export_config() {
        if [ -r ${RCFILE} ]; then
                echo "Backing up current '${RCFILE}'...."
                mv -f ${RCFILE} ${RCFILE}.$(date +%Y%m%d_%H%M)
@@ -103,7 +112,7 @@ function export_config() {
 
 # we should expand on this function to add a sample note and explain a little bit
 # how the program works.
-function firstrun() {
+firstrun() {
        [ -f $RCFILE ] && RC=$RCFILE || RC="none"
 
        clear
@@ -129,6 +138,9 @@ jq executable:              ${JQ}
                "version": "${VERSION}",
                "dbversion": "${DBVERSION}"
        },
+       "git": {
+               "lastpull": ""
+       },
        "notes": []
 }
 __EOL__