Participants: Weaver
- Previous Action Items
- Announcements
- Current Tickets
Previous Action Items
Announcements
Current Tickets
#!/usr/bin/env bash | |
# NOTE: Put me in /usr/local/bin/notes | |
case "$1" in | |
"devsync") | |
DATE=$(date "+%Y/%m") && NOTES_DIR_PATH=$(echo "$HOME/Documents/Notes/$DATE") | |
DATE=$(date "+%Y-%m-%d") && NOTES_FILE_PATH=$(echo "$NOTES_DIR_PATH/$DATE-Dev_Sync.md") | |
echo "Creating dev sync for today in $NOTES_FILE_PATH..." | |
if [ ! -d "$NOTES_DIR_PATH" ]; then | |
mkdir -p "$NOTES_DIR_PATH" | |
fi | |
if [ -f "$NOTES_FILE_PATH" ]; then | |
echo "$NOTES_FILE_PATH already exists." | |
else | |
DATE=$(date "+%Y-%m-%d") && cat "$HOME/Documents/Notes/Dev_Sync_Template.md" | sed "s|{DATE}|${DATE}|" > "$NOTES_FILE_PATH" | |
fi | |
echo "The file is: $NOTES_FILE_PATH" | |
code "$HOME/Documents/Notes" $NOTES_FILE_PATH | |
;; | |
"interview") | |
echo "Enter interview candidate name:" | |
read CANDIDATE_NAME | |
CANDIDATE_FILE=$(echo ${CANDIDATE_NAME:-"New Candidate"} | sed 's/\ /_/g') | |
DATE=$(date "+%Y/%m") && INTERVIEW_DIR_PATH=$(echo "$HOME/Documents/Notes/$DATE") | |
DATE=$(date "+%Y-%m-%d") && INTERVIEW_FILE_PATH=$(echo "$INTERVIEW_DIR_PATH/$DATE-Interview_with_$CANDIDATE_FILE.md") | |
if [ ! -d "$INTERVIEW_DIR_PATH" ]; then | |
mkdir -p "$INTERVIEW_DIR_PATH" | |
fi | |
if [ -f "$INTERVIEW_FILE_PATH" ]; then | |
echo "$INTERVIEW_FILE_PATH already exists." | |
else | |
DATE=$(date "+%Y-%m-%d") && cat "$HOME/Documents/Notes/Interview_Template.md" | sed "s|{NAME}|${CANDIDATE_NAME}|" | sed "s|{DATE}|${DATE}|" > "$INTERVIEW_FILE_PATH" | |
fi | |
echo "The file is: $INTERVIEW_FILE_PATH" | |
code "$HOME/Documents/Notes" $INTERVIEW_FILE_PATH | |
;; | |
"meeting") | |
echo "Enter meeting title:" | |
read MEETING_NAME | |
MEETING_NAME=${MEETING_NAME:-"Meeting"} | |
MEETING_FILE=$(echo ${MEETING_NAME} | sed 's/\ /_/g') | |
DATE=$(date "+%Y/%m") && MEETING_DIR_PATH=$(echo "$HOME/Documents/Notes/$DATE") | |
DATE=$(date "+%Y-%m-%d") && MEETING_FILE_PATH=$(echo "$MEETING_DIR_PATH/$DATE-$MEETING_FILE.md") | |
if [ ! -d "$MEETING_DIR_PATH" ]; then | |
mkdir -p "$MEETING_DIR_PATH" | |
fi | |
if [ -f "$MEETING_FILE_PATH" ]; then | |
echo "$MEETING_FILE_PATH already exists." | |
else | |
DATE=$(date "+%Y-%m-%d") && cat "$HOME/Documents/Notes/Meeting_Template.md" | sed "s|{TITLE}|${MEETING_NAME}|" | sed "s|{DATE}|${DATE}|" > "$MEETING_FILE_PATH" | |
fi | |
echo "The file is: $MEETING_FILE_PATH" | |
code "$HOME/Documents/Notes" $MEETING_FILE_PATH | |
;; | |
"scratch") | |
DATE=$(date "+%Y/%m") && NOTES_DIR_PATH=$(echo "$HOME/Documents/Notes/$DATE") | |
DATE=$(date "+%Y-%m-%d") && NOTES_FILE_PATH=$(echo "$NOTES_DIR_PATH/$DATE-Scratch.md") | |
echo "Creating dev sync for today in $NOTES_FILE_PATH..." | |
if [ ! -d "$NOTES_DIR_PATH" ]; then | |
mkdir -p "$NOTES_DIR_PATH" | |
fi | |
if [ -f "$NOTES_FILE_PATH" ]; then | |
echo "$NOTES_FILE_PATH already exists." | |
else | |
DATE=$(date "+%Y-%m-%d") && cat "$HOME/Documents/Notes/Scratch_Template.md" | sed "s|{DATE}|${DATE}|" > "$NOTES_FILE_PATH" | |
fi | |
echo "The file is: $NOTES_FILE_PATH" | |
code "$HOME/Documents/Notes" $NOTES_FILE_PATH | |
;; | |
*) | |
echo "usage: notes [devsync|interview|meeting|scratch]" | |
;; | |
esac |