Last active
November 1, 2016 15:47
-
-
Save xicalango/c68ee6279a97c735bc00609e915509a9 to your computer and use it in GitHub Desktop.
A small script for managing a journal.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
if [ -z ${XX_NOTES_PATH} ]; then | |
echo "Please set XX_NOTES_PATH environment variable" | |
exit 1 | |
fi | |
FILE_ID=$(date +%F) | |
FULL_PATH="${XX_NOTES_PATH}/${FILE_ID}-entry.txt" | |
date +'# %T' >> "${FULL_PATH}" | |
echo "" >> "${FULL_PATH}" | |
vim + +start "${FULL_PATH}" | |
git -C "${XX_NOTES_PATH}" add "${FULL_PATH}" | |
git -C "${XX_NOTES_PATH}" commit -m "Updated File #${FILE_ID}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment