From 2a5f3b030370e8f2af471fea0935156f664df458 Mon Sep 17 00:00:00 2001 From: Blaise Thompson Date: Mon, 23 Apr 2018 17:38:13 -0500 Subject: 2018-04-23 17:38 --- dotfiles/bashrc.sync | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/dotfiles/bashrc.sync b/dotfiles/bashrc.sync index cf7dc81..7ea5f2c 100644 --- a/dotfiles/bashrc.sync +++ b/dotfiles/bashrc.sync @@ -5,17 +5,32 @@ export PATH="/opt/anaconda/bin:$PATH" export VISUAL=vim export EDITOR="$VISUAL" -function blaise() { - echo hello -} - +# --- functions ----------------------------------------------------------------------------------- function countdown(){ - secs=$(($1 * 60)); - date1=$((`date +%s` + "$secs")); - while [ "$date1" -ge `date +%s` ]; do - echo -ne "$(date -u --date @$(($date1 - `date +%s`)) +%H:%M:%S)\r"; - sleep 0.1 - done + secs=$(($1 * 60)); + date1=$((`date +%s` + "$secs")); + while [ "$date1" -ge `date +%s` ]; do + echo -ne "$(date -u --date @$(($date1 - `date +%s`)) +%H:%M:%S)\r"; + sleep 0.1 + done +} + +function git-commit-with-timestamp(){ + echo " " + pwd + git remote update + git pull + if ! git diff --quiet + then + echo "COMMITING" + git add --all + git commit -m "$(date +"%Y-%m-%d %H:%M")" + git push + fi } +function git-sync-all(){ + cd ~/org; git-commit-with-timestamp; + cd ~/dotfiles; git-commit-with-timestamp; +} \ No newline at end of file -- cgit v1.2.3