1
0
mirror of https://github.com/aquatix/dotfiles.git synced 2025-12-06 22:55:10 +01:00
Files
dotfiles/bin/git_autosave
2018-01-02 16:39:15 +01:00

18 lines
401 B
Bash
Executable File

#!/bin/bash
if [ -n "$1" ]; then
FIRSTFILE=$1
GITDIR=$(dirname "${FIRSTFILE}")
cd "$GITDIR" || exit
DATETIME=$(date +%Y%m%d\ %H:%M:%S)
#git pull
RESULT=$(git commit "$*" -m "Autosave at $DATETIME")
echo "$RESULT"
#zenity --info --text=$RESULT
git push
else
echo "Provide one or more file paths to autosave"
zenity --error --text="Provide one or more file paths to autosave"
fi