Make function comments the same

This commit is contained in:
Ivan R. 2023-03-13 00:30:57 +05:00
parent ad76ee9733
commit 9c9acf9e83
No known key found for this signature in database
GPG key ID: 56C7BAAE859B302C

View file

@ -11,10 +11,9 @@ function _check_editor {
fi fi
} }
# Create the required directories and open a text editor
# so that the user can describe the day.
function edit_note { function edit_note {
# Creates the required directories and opens a text editor
# so that the user can describe the day.
# Create dirs (base_dir/year/month) # Create dirs (base_dir/year/month)
WORKDIR="$BASE_DIR/$(date +%Y)/$(date +%m)" WORKDIR="$BASE_DIR/$(date +%Y)/$(date +%m)"
mkdir -p $WORKDIR mkdir -p $WORKDIR
@ -29,8 +28,8 @@ function edit_note {
cd - > /dev/null cd - > /dev/null
} }
# Create an archive with all notes
function backup { function backup {
# Creates an archive with all notes
ARCHIVE_PATH=~/histd-$(date +%F).tar.xz ARCHIVE_PATH=~/histd-$(date +%F).tar.xz
cd $BASE_DIR cd $BASE_DIR
tar cfJ $ARCHIVE_PATH ../histd tar cfJ $ARCHIVE_PATH ../histd
@ -39,16 +38,18 @@ function backup {
echo Saved to $ARCHIVE_PATH echo Saved to $ARCHIVE_PATH
} }
# Concatenate all files and prefix each with the filename.
# The result will be printed to stdout.
function merge { function merge {
# This function concatenates all files and prefixes each with the filename.
# The result will be printed to stdout.
find $BASE_DIR -type f -name "*.md" -exec echo "# {}" \; -exec cat "{}" \; -exec echo \; find $BASE_DIR -type f -name "*.md" -exec echo "# {}" \; -exec cat "{}" \; -exec echo \;
} }
# Display tree of all notes
function list { function list {
tree $BASE_DIR tree $BASE_DIR
} }
# Open last note
function last { function last {
_check_editor _check_editor
LAST_FILE=$(ls -t $BASE_DIR/**/**/* | head -1) LAST_FILE=$(ls -t $BASE_DIR/**/**/* | head -1)