Fix git clone error by checking if repository already exists and using git pull instead
This commit is contained in:
1 parent
9ec67b0a45
commit
d92f557b4b
1 file changed
+7
@@ -67,8 +67,15 @@ REPO_URL="https://gitlab.com/trbc-dev/eoy-pdf-sortandmerge.git"
|
|||||||
log_info "Cloning application repository..."
|
log_info "Cloning application repository..."
|
||||||
if command -v git &> /dev/null; then
|
if command -v git &> /dev/null; then
|
||||||
sudo apt install -y git
|
sudo apt install -y git
|
||||||
|
if [[ -d ".git" ]]; then
|
||||||
|
log_info "Repository already exists, pulling latest changes..."
|
||||||
|
git pull origin web-app
|
||||||
|
git checkout web-app
|
||||||
|
else
|
||||||
|
log_info "Cloning fresh repository..."
|
||||||
git clone "$REPO_URL" .
|
git clone "$REPO_URL" .
|
||||||
git checkout web-app
|
git checkout web-app
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
log_warning "Git not available. Please manually download and extract the application files to $APP_DIR"
|
log_warning "Git not available. Please manually download and extract the application files to $APP_DIR"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in new issue
Block a user