2023-07-12 22:42:21 +03:00
|
|
|
#!/bin/bash
|
2024-02-17 16:01:00 +02:00
|
|
|
# writer 1.2 - @k@layer8.space - mit
|
|
|
|
|
|
|
|
# Use the assigned editor, if any, else use nano
|
|
|
|
[[ ${EDITOR:-"unset"} == "unset" ]] && EDITOR=nano
|
2023-07-12 22:42:21 +03:00
|
|
|
|
|
|
|
nlog() {
|
|
|
|
local ORANGE='\033[0;33m'
|
|
|
|
local NO_COLOR='\033[0m'
|
|
|
|
echo -e "${ORANGE}[noter] | ${1} ${NO_COLOR}"
|
|
|
|
}
|
|
|
|
|
|
|
|
mkdir -p notes
|
|
|
|
current_date=$(date +%Y-%m-%d)
|
|
|
|
nlog "opening note notes/$current_time.txt"
|
|
|
|
filename="notes/${current_date}.txt"
|
2024-02-17 16:01:00 +02:00
|
|
|
$EDITOR "$filename"
|
2024-02-17 17:15:39 +02:00
|
|
|
|
|
|
|
# Override publish dir if passed as cli arg
|
|
|
|
[[ ! -z "$1" ]] && publish_dir="$1"
|
|
|
|
./noter.sh "${publish_dir}"
|