Skip to content

Instantly share code, notes, and snippets.

@JHWelch
Last active February 3, 2022 21:43
Show Gist options
  • Save JHWelch/23eb3daaf9d87e9bd4c0192754e964d1 to your computer and use it in GitHub Desktop.
Save JHWelch/23eb3daaf9d87e9bd4c0192754e964d1 to your computer and use it in GitHub Desktop.
Make Notes Function
# 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