Merge branch 'master' of https://git.lea.engineering/natrox/lackadaisical
This commit is contained in:
commit
3c1a6e7374
2 changed files with 10 additions and 6 deletions
14
agenda
14
agenda
|
|
@ -24,11 +24,15 @@ if [[ $1 == '' ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
root_dir=$(dirname $1)/.daisy/$(basename $1)
|
||||
today_sym=$1
|
||||
dir=$(realpath -s "$1")
|
||||
parent_dir=$(dirname "$dir")
|
||||
name=$(basename "$dir")
|
||||
root_dir="$parent_dir/.daisy/$name"
|
||||
today_sym="$dir"
|
||||
|
||||
# Present day
|
||||
read year month day < <(date "+%Y %m %d")
|
||||
today="$root_dir/$year/$month/$day"
|
||||
|
||||
set -e
|
||||
|
||||
|
|
@ -50,7 +54,7 @@ trap errorFn ERR
|
|||
test -e "$root_dir" && find "$root_dir" -maxdepth 3 -type d -empty -delete
|
||||
|
||||
# Now we can set up today's directory
|
||||
mkdir -p "$root_dir/$year/$month/$day"
|
||||
ln -sf "$root_dir/$year/$month/$day" "$today_sym"
|
||||
ln -s "$root_dir" "$today_sym/.tree"
|
||||
mkdir -p "$today"
|
||||
ln -snf "$today" "$today_sym"
|
||||
ln -snf "$root_dir" "$dir/.tree"
|
||||
exitcode=$?
|
||||
|
|
|
|||
2
editx
2
editx
|
|
@ -20,7 +20,7 @@ fi
|
|||
|
||||
touch "$1"
|
||||
chmod +x "$1"
|
||||
daisy_editor "$1"
|
||||
daisy editor "$1"
|
||||
|
||||
if [[ ! -s "$1" && $existed -eq 0 ]]; then
|
||||
rm -f "$1"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue