Commit 055b8577 authored by Jan Hensel's avatar Jan Hensel 🐧
Browse files

zet: Fix updating kaesten

parent 39b3ae27
......@@ -38,13 +38,29 @@ update_kasten()
(
echo "updating ${category}..."
cd "${zettelkasten_path}/${category}"
local_update=false
remote_update=false
if [[ $(git status --porcelain) ]]; then
local_update=true
fi
if [[ $(git fetch) ]]; then
git pull --rebase
remote_update=true
fi
if [[ $(git status --porcelain) ]]; then
if [ "${local_update}" == "true" ]; then
git add .
git commit -m "$day Update"
git push
fi
can_push=true
if [ "${remote_update}" == "true" ]; then
git pull --rebase || can_push=false
fi
if [ "${local_update}" == "true" ]; then
if [ "${can_push}" == "true" ]; then
git push
else
echo "WARN: cannot push update in ${category} yet!"
fi
fi
)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment