Moving noter to common

This commit is contained in:
Siina Mashek 2024-02-28 09:25:18 +02:00
parent 673e4ef837
commit befe646d68
2 changed files with 20 additions and 19 deletions

View File

@ -1,19 +0,0 @@
#!/bin/sh
site_dir="$HOME/projects/siina.monster"
current_date=$(date +%Y-%m-%d)
timestamp=$(date +%H:%M:%S)
current_note="$site_dir/notes/${current_date}.txt"
if [ -z "$1" ]; then
echo -e "\n<p><b>$(echo $timestamp)</b>: </p>" >> $current_note
cd $site_dir && make
else
echo -e "\n<p><b>$(echo $timestamp)</b>: ${1}</p>" >> $current_note
fi
cd $site_dir
./noter/noter.sh public
make push publish

20
common/noter Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh
site_dir="$HOME/Projects/siina.monster"
current_date=$(date +%Y-%m-%d)
timestamp=$(date +%H:%M:%S)
current_note="$site_dir/notes/${current_date}.txt"
publish () {
cd $site_dir && make push publish
}
if [ -z "$1" ]; then
cd $site_dir && ./noter/writer.sh public
elif [[ "$1" -eq "publish" ]]; then
publish
else
echo -e "<p><b>$(echo $timestamp)</b>: ${1}</p>\n" >> $current_note
fi