Skip to content

Instantly share code, notes, and snippets.

@libdx
Created March 4, 2019 15:46
Show Gist options
  • Save libdx/d13b2b403b6aca5304aa25fd505347a2 to your computer and use it in GitHub Desktop.
Save libdx/d13b2b403b6aca5304aa25fd505347a2 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
(
NOTES_REPO=~/.notes
FILE_PATH=$1
DIR_PATH=$(dirname $FILE_PATH)
cd $NOTES_REPO
if [ ! -d $DIR_PATH ]; then
mkdir -p $(dirname $DIR_PATH)
fi
vim $FILE_PATH
git add $FILE_PATH
git commit -m "Work on $FILE_PATH"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment