Force remove project dir if not a git directory

This commit is contained in:
Jeremy Soller 2018-06-09 20:40:41 -06:00
parent 5d91f858a4
commit 83848415b5

View file

@ -37,7 +37,7 @@ before_script:
build: build:
script: script:
- | - |
ls && [ -d "$CI_PROJECT_DIR" -a ! -d "$CI_PROJECT_DIR/.git" ] && rm -rf "$CI_PROJECT_DIR" &&
[ -d "$CI_PROJECT_DIR" ] || git clone "$CI_BUILD_REPO" "$CI_PROJECT_DIR" && [ -d "$CI_PROJECT_DIR" ] || git clone "$CI_BUILD_REPO" "$CI_PROJECT_DIR" &&
cd "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR" &&
git remote set-url origin "$CI_BUILD_REPO" && git remote set-url origin "$CI_BUILD_REPO" &&