From 1fcc67d94f6b30775049458d871327e7bedfa4f5 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Thu, 5 Oct 2023 14:25:14 +0200 Subject: [PATCH] add init repo script checking submodules exist --- .gitignore | 1 + Makefile | 11 +---------- init_repo.sh | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 init_repo.sh diff --git a/.gitignore b/.gitignore index ca7fd56..642f83c 100755 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ .idea/**/usage.statistics.xml .idea/**/dictionaries .idea/**/shelf +.idea # AWS User-specific .idea/**/aws.xml diff --git a/Makefile b/Makefile index 3b4600a..274f960 100755 --- a/Makefile +++ b/Makefile @@ -1,14 +1,5 @@ default: - echo "installing teambrains dev tools" - pip install mkdocs - pip install mkdocs-material - echo "installing teambrains git submodules" - # https://git-scm.com/book/en/v2/Git-Tools-Submodules - git submodule add git@github.com:cogiway/faq2_api.git - git submodule add git@github.com:cogiway/faq2_example.git - git submodule add git@github.com:cogiway/faq2_model.git - git submodule init - echo "checking requirements" + bash init_repo.sh documentation: echo "build mkdoc" mkdocs build diff --git a/init_repo.sh b/init_repo.sh new file mode 100644 index 0000000..1882a2e --- /dev/null +++ b/init_repo.sh @@ -0,0 +1,23 @@ +#!/bin/bash +echo "installing teambrains dev tools" +pip install mkdocs +pip install mkdocs-material +echo "installing teambrains git submodules" +# https://git-scm.com/book/en/v2/Git-Tools-Submodules +if [ -d "faq2_api" ]; then + git submodule add git@github.com:cogiway/faq2_api.git +fi +if [ -d "faq2_example" ]; then + git submodule add -f git@github.com:cogiway/faq2_example.git +fi +if [ ! hash mkdocs]; then + +fi +if [ -d "faq2_model" ]; then + git submodule add -f git@github.com:cogiway/faq2_model.git +fi + +git submodule init +git submodule sync +git submodule update +echo "checking requirements"