From cff6d63c516b26eaeb7c3c3724529a55cc240165 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Thu, 2 Jun 2022 16:00:07 +0200 Subject: [PATCH] Add pull_customer_directory --- git_helpers.sh | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/git_helpers.sh b/git_helpers.sh index 5325222..a693e29 100755 --- a/git_helpers.sh +++ b/git_helpers.sh @@ -1,5 +1,8 @@ #!/bin/bash -set -x +# set -x + +GIT_SSL_NO_VERIFY=true + commit_before_pull="" save_commit_before_pull () { @@ -32,10 +35,24 @@ clone_customer_repository () { `git clone https://git.mimbach49.de/GerhardHoffmann/customer_281.git` fi } +# clone_customer_repository create_workspace () { `mkdir -p ./workspace` - if [ $? -eq 0 ]; then - clone_customer_repository - fi + return 0 } + +set -x +pull_customer_repository () { + cd ./workspace/customer_281 + if [ $? -ne 0 ]; then + return 1 + fi + if [ "$(git pull)" = "Already up to date." ]; then + cd - &>/dev/null + return 1 + fi + cd - &>/dev/null + return 0 +} +pull_customer_repository