Had to update path-names to allow scripts to access the files after update to journals.sh

This commit is contained in:
2023-12-08 12:07:31 -06:00
parent fa16efc488
commit 4759318d29
9 changed files with 72 additions and 60 deletions

View File

@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/opt/homebrew/bin/bash
: "
get_task_number
This function will query sqlite db to either get the number of a task OR create the task and return the number

View File

@@ -1,8 +1,18 @@
#!/usr/bin/bash
#!/opt/homebrew/bin/bash
function get_journals () {
local JOURNAL_REGEX='[0-9]{4}-[0-9]{2}-[0-9]{2}.wiki'
[[ "$1" ]] && declare -n hashmap="$1"
hashmap=( $( ls $JOURNAL_DIR -1 | grep -Eo $JOURNAL_REGEX | sort -n ) )
declare -n array="${1:?"get_journals : Variable not passed through"}"
array=( $( ls -1 $JOURNAL_DIR | grep -Eo $JOURNAL_REGEX | sort -n ) )
local file
for i in ${!array[@]}; do
file="${array[$i]}"
DIR=`basename $JOURNAL_DIR`
if [[ "$file" != $DIR/* ]]; then
file="/$DIR/$file"
array[$i]=$file
fi
done
}

View File

@@ -1,5 +1,5 @@
#!/usr/bin/bash
[[ -f ~/Journal/utils/journals.sh ]] && . ~/Journal/utils/journals.sh
#!/opt/homebrew/bin/bash
[[ -f ~/Notes/utils/journals.sh ]] && . ~/Notes/utils/journals.sh
function get_tasks () {
set -x

View File

@@ -1,5 +1,5 @@
#!/usr/bin/bash
[[ -f ~/Journal/utils/journals.sh ]] && . ~/Journal/utils/journals.sh
#!/opt/homebrew/bin/bash
[[ -f ~/Notes/utils/journals.sh ]] && . ~/Notes/utils/journals.sh
function get_tasks () {
local -a journals