You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
287 B
24 lines
287 B
6 years ago
|
#!/bin/bash
|
||
|
#
|
||
|
# clone or pull an existing git repository
|
||
|
#
|
||
|
# (C) 2019 vanhofen
|
||
|
# License: WTFPLv2
|
||
|
#
|
||
|
# parameters:
|
||
|
# * git URL
|
||
|
# * destination directory
|
||
|
#
|
||
|
GIT_URL="$1"
|
||
|
DEST="$2"
|
||
|
|
||
6 years ago
|
# exit on error
|
||
|
set -e
|
||
|
|
||
6 years ago
|
if [ -d $DEST ]; then
|
||
|
cd $DEST
|
||
|
git pull || true
|
||
|
else
|
||
|
git clone $GIT_URL $DEST
|
||
|
fi
|