From befe646d685d8bf2b359bfe72a5a3b889721538c Mon Sep 17 00:00:00 2001 From: Siina Mashek Date: Wed, 28 Feb 2024 09:25:18 +0200 Subject: [PATCH] Moving noter to common --- apsalar/noter | 19 ------------------- common/noter | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 19 deletions(-) delete mode 100755 apsalar/noter create mode 100755 common/noter diff --git a/apsalar/noter b/apsalar/noter deleted file mode 100755 index 91d18b0..0000000 --- a/apsalar/noter +++ /dev/null @@ -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

$(echo $timestamp):

" >> $current_note - cd $site_dir && make -else - echo -e "\n

$(echo $timestamp): ${1}

" >> $current_note -fi - -cd $site_dir -./noter/noter.sh public -make push publish - diff --git a/common/noter b/common/noter new file mode 100755 index 0000000..553ab9b --- /dev/null +++ b/common/noter @@ -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 "

$(echo $timestamp): ${1}

\n" >> $current_note +fi +