From a16efca58cbc6708fa086e809d871867d71987da Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 17 May 2019 23:32:51 +0200 Subject: [PATCH] - helpers: add script to get or update git repositories --- helpers/get-git-source.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 helpers/get-git-source.sh diff --git a/helpers/get-git-source.sh b/helpers/get-git-source.sh new file mode 100755 index 00000000..a169759d --- /dev/null +++ b/helpers/get-git-source.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# clone or pull an existing git repository +# +# (C) 2019 vanhofen +# License: WTFPLv2 +# +# parameters: +# * git URL +# * destination directory +# +GIT_URL="$1" +DEST="$2" + +if [ -d $DEST ]; then + cd $DEST + git pull || true +else + git clone $GIT_URL $DEST +fi