Skip to content

Commit

Permalink
Обновляем зависимости
Browse files Browse the repository at this point in the history
  • Loading branch information
anyks committed Jan 15, 2025
1 parent 5137b9e commit cbd79db
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 3 deletions.
43 changes: 43 additions & 0 deletions submodule.sh
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
19 changes: 19 additions & 0 deletions submodules.sh
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
2 changes: 1 addition & 1 deletion submodules/awh
Submodule awh updated from 80eebf to 2742e2
2 changes: 1 addition & 1 deletion submodules/libxml2
Submodule libxml2 updated from de918d to a335ff
2 changes: 1 addition & 1 deletion submodules/yaml
Submodule yaml updated from f73201 to f7fbea

0 comments on commit cbd79db

Please sign in to comment.