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.
18 lines
332 B
18 lines
332 B
4 years ago
|
#!/bin/sh
|
||
|
|
||
|
set -e
|
||
|
|
||
4 years ago
|
REPO_URL="${1}"
|
||
|
REPO_DIR_PATH="${2}"
|
||
4 years ago
|
|
||
|
# If repo exists update, else clone it
|
||
|
if [ -d "$REPO_DIR_PATH" ]; then
|
||
|
# Save the root dir path, enter the repo, pull new changes and come back
|
||
|
ROOT_DIR=$(pwd)
|
||
|
cd "$REPO_DIR_PATH"
|
||
|
git pull
|
||
|
cd "$ROOT_DIR"
|
||
|
else
|
||
|
git clone "$REPO_URL" "$REPO_DIR_PATH"
|
||
|
fi
|