Last active
February 3, 2022 21:43
-
-
Save JHWelch/23eb3daaf9d87e9bd4c0192754e964d1 to your computer and use it in GitHub Desktop.
Make Notes Function
This file contains hidden or 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
# Add notes.md to global .gitignore at ~/.gitignore | |
NOTES_DIR=~/Notes/Repos # Update to global note directory | |
mknotes() { | |
if test -f "./notes.md"; then | |
echo 'notes.md already exists in this directory' | |
return 1 | |
fi | |
repo=$(basename "$PWD") | |
new_note="$NOTES_DIR/$repo.md" | |
echo "# $repo" > "$new_note" | |
echo "Created new note at $new_note" | |
ln -s $new_note notes.md | |
echo "Linked note to 'notes.md'" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment