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.
docker-bibliogram/build.updaterepo.sh

18 lines
332 B

#!/bin/sh
set -e
3 years ago
REPO_URL="${1}"
REPO_DIR_PATH="${2}"
# 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