Created
February 12, 2023 17:34
-
-
Save cowlike/0140ed3fcb6dbe78152e585f36e2bc3c to your computer and use it in GitHub Desktop.
obsidian sync
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 sh | |
OB_PATH="~/Documents/obsidian" | |
cd "$OB_PATH" | |
echo "$(date): updating folder: $(pwd)" | |
git pull | |
CHANGES_EXIST="$(git status — porcelain | wc -l)" | |
if [ "$CHANGES_EXIST" -eq 0 ]; then | |
exit 0 | |
fi | |
git add . | |
git commit -q -m "$(date +"%Y-%m-%d %H:%M:%S")" | |
git push -q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment