After gemini-propoesed fixes
This commit is contained in:
parent
2e31283b61
commit
83324dd0f7
11 changed files with 228 additions and 307 deletions
12
agenda
12
agenda
|
|
@ -28,10 +28,7 @@ root_dir=$(dirname $1)/.daisy/$(basename $1)
|
|||
today_sym=$1
|
||||
|
||||
# Present day
|
||||
today=$(date -I)
|
||||
year=$(echo $today | awk -F"-" '{print $1}')
|
||||
month=$(echo $today | awk -F"-" '{print $2}')
|
||||
day=$(echo $today | awk -F"-" '{print $3}')
|
||||
read year month day < <(date "+%Y %m %d")
|
||||
|
||||
set -e
|
||||
|
||||
|
|
@ -50,11 +47,10 @@ function errorFn
|
|||
trap errorFn ERR
|
||||
|
||||
# First we clear out empty folders, and remove the symlink if it exists
|
||||
test -e "$root_dir" && find "$root_dir" -maxdepth 3 -type d -empty -print | xargs rm -rf
|
||||
test -L "$today_sym" && rm -rf "$today_sym"
|
||||
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 -s "$root_dir/$year/$month/$day" "$today_sym"
|
||||
ln -sf "$root_dir/$year/$month/$day" "$today_sym"
|
||||
ln -s "$root_dir" "$today_sym/.tree"
|
||||
exitcode=@?
|
||||
exitcode=$?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue