Fixed a bug that was causing git pushes of notes to fail.

This commit is contained in:
stormdragon2976
2023-04-05 15:57:36 -04:00
parent 37066b6a9b
commit 4fd80ee6de

View File

@@ -109,8 +109,8 @@ add_note() {
if [ -f "${xdgPath}/notestorm/notes/${noteName}.md" ]; then
infobox "Note added."
if [[ -d "$xdgPath/notestorm/notes/.git" ]]; then
{ git -C "$xdgPath/notestorm/notes" add -A
git -C "$xdgPath/notestorm/notes" commit -m "$(*gettext "Automatic push from notestorm, note added.")"
{ git -C "$xdgPath/notestorm/notes" add -A :/
git -C "$xdgPath/notestorm/notes" commit -m "$(gettext "Automatic push from notestorm, note added.")"
git -C "$xdgPath/notestorm/notes" push ; } | dialog --progressbox "$(gettext "Pushing to git...")" -1 -1
fi
else
@@ -140,7 +140,7 @@ delete_note() {
infobox "$(gettext "Note deleted.")"
if [[ -d "$xdgPath/notestorm/notes/.git" ]]; then
{ git -C "$xdgPath/notestorm/notes" rm -f "$1"
git -C "$xdgPath/notestorm/notes" commit -m "$(*gettext "Automatic push from notestorm, note deleted.")"
git -C "$xdgPath/notestorm/notes" commit -m "$(gettext "Automatic push from notestorm, note deleted.")"
git -C "$xdgPath/notestorm/notes" push ; } | dialog --progressbox "$(gettext "Pushing to git...")" -1 -1
fi
else
@@ -173,8 +173,8 @@ edit_note() {
if [ "$oldMd5" != "$newMd5" ]; then
infobox "$(gettext "Changes saved.")"
if [[ -d "$xdgPath/notestorm/notes/.git" ]]; then
{ git -C "$xdgPath/notestorm/notes" add -A
git -C "$xdgPath/notestorm/notes" commit -m "$(*gettext "Automatic push from notestorm, note updated.")"
{ git -C "$xdgPath/notestorm/notes" add -A :/
git -C "$xdgPath/notestorm/notes" commit -m "$(gettext "Automatic push from notestorm, note updated.")"
git -C "$xdgPath/notestorm/notes" push ; } | dialog --progressbox "$(gettext "Pushing to git...")" -1 -1
fi
else
@@ -198,9 +198,9 @@ encrypt_note() {
rm -f "$1"
infobox "$(gettext "Note encrypted.")"
if [[ -d "$xdgPath/notestorm/notes/.git" ]]; then
{ git -C "$xdgPath/notestorm/notes" add -A
{ git -C "$xdgPath/notestorm/notes" add -A :/
git rm -f "$1"
git -C "$xdgPath/notestorm/notes" commit -m "$(*gettext "Automatic push from notestorm, note encrypted.")"
git -C "$xdgPath/notestorm/notes" commit -m "$(gettext "Automatic push from notestorm, note encrypted.")"
git -C "$xdgPath/notestorm/notes" push ; } | dialog --progressbox "$(gettext "Pushing to git...")" -1 -1
fi
return