-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Submodule awh
updated
from 80eebf to 2742e2
Submodule libxml2
updated
from de918d to a335ff
Submodule yaml
updated
from f73201 to f7fbea