1
0
Fork 0
pomodoro/bash_scripts/repo_local.tmpl.sh
2024-02-29 22:58:26 +03:00

50 lines
1.7 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

if [ -z "$remote" ] || [ -z "$owner" ] || [ -z "$repo" ] || [ -z "$folder" ]; then
echo "Не указаны обязательные параметры." && exit 2
fi
echo "Создание локального репозитория, подключение к удалённому и передача данных."
seconds=3
currentTimeMillis=$(date '+%s%3N')
rm -rf .git
git init -b master
git remote add "$remote" "git@$remote:$owner/$repo.git"
git add .git*
git commit -m "Инициализация / $folder"
if [ "$remote" == "hub.mos.ru" ]; then
echo "Второй пуш, потому что лингвист с первого раза не срабатывает."
git push -u "$remote" master
echo "Ожидание $seconds с."
sleep $seconds
fi
git add CONTRIBUTING.md
git add \*LICENSE*
git commit -m "Открытая лицензия РФ"
git add DIRECTORY_TREE.md
git add WIKI.md
git add \*README*
git commit -m "Описание проекта"
git add \*.yml
git add \*Gemfile*
git add \*install.sh
git add \*.gemspec
git add \*robots.txt
git commit -m "Настройки"
git add \*.sh
git commit -m "Скрипты bash"
git add \*.min.css
git add \*.min.js
git add \*.woff
git commit -m "Сторонние материалы"
git add \*.bmp
git add \*.gif
git add \*.ico
git add \*.jpg
git add \*.png
git add \*.svg
git commit -m "Картинки"
find . -type f -not -path "*/.*" -not -path "./_site*" | sort -r | while read -r file; do
echo "Обработка: $file"
git add "$file"
git commit -m "${file#*/}"
done
git push -u "$remote" master
echo "Время создания локального репозитория: $(("$(date '+%s%3N')" - "$currentTimeMillis")) мс."