diff --git a/submodule.sh b/submodule.sh new file mode 100755 index 0000000..ec2624f --- /dev/null +++ b/submodule.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +# Получаем корневую дирректорию +readonly ROOT=$(cd "$(dirname "$0")" && pwd) + +# Если команда указана +if [ -n "$1" ]; then + # Если команда указана удаление сабмодуля + if [ $1 = "remove" ]; then + # Если название сабмодуля для удаления указано + if [ -n "$2" ]; then + # Удаляем указанный сабмодуль + git submodule deinit -f -- $ROOT/submodules/$2 + rm -rf $ROOT/.git/modules/submodules/$2 + git rm -rf $ROOT/submodules/$2 + # git rm --cached $ROOT/submodules/$2 + # Выводим сообщение что удаление выполнено + echo "Submodule \"$2\" removed successfully" + else + echo "Submodule name to remove is not specified" + fi + # Если команда указана добавления собмодуля + elif [ $1 = "add" ]; then + # Если название сабмодуля для удаления указано + if [ -n "$2" ]; then + # Если URL-адрес сабмодуля передан + if [ -n "$3" ]; then + # Добавляем новый сабмодуль + git submodule add $3 submodules/$2 + # Выводим сообщение что добавление выполнено + echo "Submodule \"$2\" added successfully" + else + echo "URL address of the submodule is not specified" + fi + else + echo "Submodule name to add is not specified" + fi + else + echo "An unknown command was entered, enter \"remove\" or \"add\"" + fi +else + echo "Command is not specified" +fi diff --git a/submodules.sh b/submodules.sh new file mode 100755 index 0000000..071fec0 --- /dev/null +++ b/submodules.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# Получаем корневую дирректорию +readonly ROOT=$(cd "$(dirname "$0")" && pwd) + +# Выполняем пересборку сабмодуля awh +$ROOT/submodule.sh remove awh +$ROOT/submodule.sh add awh https://gitflic.ru/project/anyks/awh.git + +# Выполняем пересборку сабмодуля yaml +$ROOT/submodule.sh remove yaml +$ROOT/submodule.sh add yaml https://gitflic.ru/project/third_party/yaml-cpp.git + +# Выполняем пересборку сабмодуля libxml2 +$ROOT/submodule.sh remove libxml2 +$ROOT/submodule.sh add libxml2 https://gitflic.ru/project/third_party/libxml2.git + +# Выводим список добавленных модулей +cat $ROOT/.gitmodules diff --git a/submodules/awh b/submodules/awh index 80eebf6..2742e2d 160000 --- a/submodules/awh +++ b/submodules/awh @@ -1 +1 @@ -Subproject commit 80eebf60c38e752c58ba181ba1dd2174ba1eaad7 +Subproject commit 2742e2d498a75e9118cf1f62ddfd6a32bf44cfc7 diff --git a/submodules/libxml2 b/submodules/libxml2 index de918d4..a335fff 160000 --- a/submodules/libxml2 +++ b/submodules/libxml2 @@ -1 +1 @@ -Subproject commit de918d45e1b2276a28a4cd32bcf556bef65284e4 +Subproject commit a335fffd034ffe8d7bc502c768a306d001b5ea90 diff --git a/submodules/yaml b/submodules/yaml index f732014..f7fbea7 160000 --- a/submodules/yaml +++ b/submodules/yaml @@ -1 +1 @@ -Subproject commit f7320141120f720aecc4c32be25586e7da9eb978 +Subproject commit f7fbea75b4b9e545446d4f8c1910a96c78825fa6