From d69e8774aea3a728d9071afdcdb851eae9f6214c Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sun, 27 Nov 2011 17:44:27 -0800 Subject: [PATCH] make that update-git-repo.sh --- update-blog-mail.sh | 8 -------- update-git-repo.sh | 12 ++++++++++++ 2 files changed, 12 insertions(+), 8 deletions(-) delete mode 100755 update-blog-mail.sh create mode 100755 update-git-repo.sh diff --git a/update-blog-mail.sh b/update-blog-mail.sh deleted file mode 100755 index 7f66a5c..0000000 --- a/update-blog-mail.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -if [[ -d /home/sjs/blog-mail ]]; then - cd /home/sjs/blog-mail - git clean -fq - git pull -fi - diff --git a/update-git-repo.sh b/update-git-repo.sh new file mode 100755 index 0000000..450158a --- /dev/null +++ b/update-git-repo.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +dir="$1" +if [[ -d "$1/.git" ]]; then + cd "$1" + git clean -fq + git pull +else + echo "error: $1 is not a git repo" + exit 1 +fi +