forked from discordia-space/CEV-Eris
-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
706956a
commit 80faa01
Showing
14 changed files
with
873 additions
and
6 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 |
---|---|---|
@@ -1,9 +1,61 @@ | ||
![](https://cdn.discordapp.com/attachments/265411250341543936/269612274765791242/eris_128.png) | ||
# Endless Horizon: CEV-Eris [![Build Status](https://travis-ci.org/discordia-space/CEV-Eris.svg?branch=master)](https://travis-ci.org/Endless-Horizon/CEV-Eris) | ||
[![discord](https://discordapp.com/api/guilds/255035529085583360/widget.png)](https://discord.gg/QfEg7K7) | ||
<div align="center"> | ||
|
||
Корабль, который должен умирать. | ||
![](https://map.celadon.pro/Eris/Files/Logos/Cev_logo.png) | ||
|
||
## CONTRIBUTING | ||
# CEV-Eris | ||
[![Compile](https://github.com/shiptest-ss13/Shiptest/workflows/Checks/badge.svg)](https://github.com/CeladonSS13/CEV-Eris/actions/workflows/compile_changelogs.yml) [![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3.0-blue.svg)](https://opensource.org/licenses/AGPL-3.0) | ||
|
||
Please see [CONTRIBUTING.md](CONTRIBUTING.md) | ||
</div> | ||
|
||
<table> | ||
<tr><td align="center" width="2000"><b> | ||
<a href="https://github.com/discordia-space/CEV-Eris">Upstream</a> • | ||
<a href="https://discord.gg/rxsggTJzY3">Discord</a> • | ||
<a href="https://wiki.celadon.pro/">Wiki</a> • | ||
<a href="https://boosty.to/celadon">Patreon</a> | ||
</b></td></tr> | ||
<tr><td align="center" width="2000"><b> | ||
<a href="#рекомендации-для-контрибьюторов">Коллаборация</a> • | ||
<a href="#безопасность">Безопасность</a> • | ||
<a href="#лизцензия">Лицензия</a> • | ||
<a href="#получение-кода-и-установка">Установка</a> | ||
</b></td></tr> | ||
</table> | ||
|
||
--- | ||
|
||
### Рекомендации для контрибьюторов | ||
|
||
**Пожалуйста, воздержись от написания комментариев, не связанных с кодом в PR на GitHub.** Ознакомься с Правилами Поведения, где сказано о том где следует оставлять отзывы пользователям. | ||
|
||
Ожидается, что все пользователи ознакомятся с [`CONTRIBUTING.md`](CONTRIBUTING.md) перед взаимодействием с репозиторием или другими пользователями. | ||
|
||
Для оформления мёрж-рекввестом и для работы с кодом рекумендуется ознакомиться с [документацией по оформлению и работе с PR-ами](https://github.com/CeladonSS13/Shiptest/blob/alpha-stable/.github/CONTRIBUTING.md). | ||
|
||
--- | ||
|
||
### Безопасность | ||
|
||
С Политикой Безопасности этого репозитория, а также с тем, как репортить уязвимости ты можешь ознакомиться в [`/docs/SECURITY.md`](/docs/SECURITY.md). | ||
|
||
--- | ||
|
||
### Лизцензия | ||
|
||
Код Tgstantion, и, следовательно, Shiptest лицензируется в соответствии с [GNU Affero General Public License v3](https://www.gnu.org/licenses/agpl.html), полное содержание которой находится в файле [`LICENSE`](/LICENSE). | ||
|
||
Код с датой авторства git до `1420675200 +0000` (08.01.2015, 00:00 GMT) распространяется под лицензией [GNU General Public License v3](https://www.gnu.org/licenses/gpl-3.0.html), с полной версией которой вы можете ознакомиться в [`/docs/GPLv3.txt`](/docs/GPLv3.txt). | ||
|
||
Предполагается, что весь код, авторство которого датируется `1420675200 +0000` или позже, лицензируется по AGPL v3. Если вы хотите лицензировать по GPL v3, укажите это в сообщении коммита, а также внутри всех добавленных файлов. | ||
|
||
Если ты желаешь разрабатывать и хостить эту кодбазу, закрыв исходный код, ты можешь использовать все коммиты до `1420675200 +0000`, которые лицензированы по GPL v3. Главное различие заключается в том, что если ты хостишь сервер, используя любой код, лицензированный в соответствии с AGPLv3, ты должен предоставить полный исходный код для пользователей ваших серверов, включая дополнения и изменения, которые ты сделал. | ||
|
||
Статья ["Зачем нужна GPL Афферо"](https://www.gnu.org/licenses/why-affero-gpl.html) рассказывает об этом подробнее. | ||
|
||
Все ассеты, включая иконки и звуки, лицензируются по [Creative Commons 3.0 BY-SA license](https://creativecommons.org/licenses/by-sa/3.0/), если не указано иное. | ||
|
||
--- | ||
|
||
### Получение кода и установка | ||
|
||
Все инструкции по получению, установке, обновлению и запуску этого кода находятся можно изучить в [`/docs/installation.md`](/docs/installation.md). |
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
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,68 @@ | ||
$COLOR_RESET = [char]27 + '[0m' | ||
$COLOR_GREEN = [char]27 + '[32m' | ||
$COLOR_BLUE = [char]27 + '[36m' | ||
|
||
$script_dir = Split-Path -Parent $MyInvocation.MyCommand.Path | ||
$mod_name = "" | ||
$mod_name_upper = "" | ||
$mod_name_lower = "" | ||
|
||
while (-not $mod_name) { | ||
Write-Host "${COLOR_GREEN}| ${COLOR_RESET}Название мода пишется заглавными буквами, а также с" | ||
Write-Host "${COLOR_GREEN}| ${COLOR_RESET}использованием подчёркиваний вместо пробелов или тире." | ||
Write-Host "${COLOR_GREEN}| ${COLOR_RESET}Пример: COOKIE_FACTORY" | ||
$mod_name = Read-Host "${COLOR_BLUE}> ${COLOR_RESET}Введи название мода" | ||
Write-Host | ||
$mod_name = $mod_name -replace '\s|-', '_' | ||
|
||
$mod_name_upper = $mod_name.ToUpper() | ||
$mod_name_lower = $mod_name.ToLower() | ||
|
||
Write-Host "${COLOR_GREEN}| ${COLOR_RESET}Выбранное название: ${mod_name_upper} / ${mod_name_lower}" | ||
$confirmation = Read-Host "${COLOR_BLUE}> ${COLOR_RESET}Всё верно? (Y/n)" | ||
Write-Host | ||
if ($confirmation -and $confirmation.ToLower() -ne "y") { | ||
$mod_name = "" | ||
} | ||
} | ||
|
||
if (-Not (Test-Path "$script_dir\_example" -PathType Container)) { | ||
Write-Host "Папка mods\_example не найдена. Убедись что она существует и попробуй ещё раз." | ||
Exit | ||
} | ||
|
||
$modpack_dir = Join-Path -Path $script_dir -ChildPath $mod_name_lower | ||
if (Test-Path "$modpack_dir" -PathType Container) { | ||
Write-Host "Папка mods\$mod_name_lower уже существует." | ||
Exit | ||
} | ||
|
||
New-Item -ItemType Directory -Path "$modpack_dir" | Out-Null | ||
|
||
Get-ChildItem -Path "$script_dir\_example" | ForEach-Object { | ||
$source = $_.FullName | ||
$destination = Join-Path $modpack_dir $_.Name | ||
|
||
if ($_.PSIsContainer) { | ||
Copy-Item -Path $source -Destination $destination -Recurse | ||
} else { | ||
Copy-Item -Path $source -Destination $destination | ||
} | ||
} | ||
|
||
# Rename files | ||
Get-ChildItem "$modpack_dir" | ForEach-Object { | ||
$newName = $_.Name -replace "_example", "_$mod_name_lower" | ||
Rename-Item -Path $_.FullName -NewName $newName | ||
} | ||
|
||
# Process and update content of all the files | ||
Get-ChildItem "$modpack_dir\*.*" | ForEach-Object { | ||
$content = Get-Content $_.FullName | ForEach-Object { | ||
$_ -creplace "EXAMPLE", $mod_name_upper -creplace "example", $mod_name_lower | ||
} | ||
$content | Set-Content $_.FullName | ||
} | ||
|
||
Write-Host "Готово! Файлы для мода $mod_name_upper созданы." | ||
Write-Host "Находятся они в папке mods/$mod_name_lower." |
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,66 @@ | ||
import os | ||
import shutil | ||
|
||
COLOR_RESET = '\033[0m' | ||
COLOR_GREEN = '\033[32m' | ||
COLOR_BLUE = '\033[36m' | ||
|
||
script_dir = os.path.dirname(os.path.realpath(__file__)) | ||
mod_name = "" | ||
mod_name_upper = "" | ||
mod_name_lower = "" | ||
|
||
|
||
while not mod_name: | ||
print(f"{COLOR_GREEN}| {COLOR_RESET}Название мода пишется заглавными буквами, а также с") | ||
print(f"{COLOR_GREEN}| {COLOR_RESET}использованием подчёркиваний вместо пробелов или тире.") | ||
print(f"{COLOR_GREEN}| {COLOR_RESET}Пример: COOKIE_FACTORY") | ||
mod_name = input(f"{COLOR_BLUE}> {COLOR_RESET}Введи название мода: ") | ||
print() | ||
mod_name = mod_name.replace(' ', '_') | ||
mod_name = mod_name.replace('-', '_') | ||
|
||
mod_name_upper = mod_name.upper() | ||
mod_name_lower = mod_name.lower() | ||
|
||
print(f"{COLOR_GREEN}| {COLOR_RESET}Выбранное название: {mod_name_upper} / {mod_name_lower}") | ||
confirmation = input(f"{COLOR_BLUE}> {COLOR_RESET}Всё верно? (Y/n) ").lower() | ||
print() | ||
if confirmation and confirmation != "y": | ||
mod_name = "" | ||
|
||
if not os.path.exists(f"{script_dir}/_example"): | ||
print("Папка mods/_example не найдена. Убедись что она существует и попробуй ещё раз.") | ||
print() | ||
input("Нажмите Enter для закрытия...") | ||
exit() | ||
|
||
if os.path.exists(f"{script_dir}/{mod_name_lower}"): | ||
print(f"Папка mods/{mod_name_lower} уже существует.") | ||
print() | ||
input("Нажмите Enter для закрытия...") | ||
exit() | ||
|
||
os.mkdir(f"{script_dir}/{mod_name_lower}") | ||
|
||
for filename in os.listdir(f"{script_dir}/_example"): | ||
source = f"{script_dir}/_example/{filename}" | ||
destination = f"{script_dir}/{mod_name_lower}/{filename}" | ||
|
||
if os.path.isdir(source): | ||
shutil.copytree(source, destination) | ||
else: | ||
with open(source, 'r', encoding="utf8") as src_file, open(destination, 'w', encoding="utf8") as dest_file: | ||
dest_file.write(src_file.read().replace("EXAMPLE", mod_name_upper).replace("example", mod_name_lower)) | ||
|
||
|
||
# Rename files | ||
for filename in os.listdir(f"{script_dir}/{mod_name_lower}"): | ||
new_name = filename.replace("_example", f"_{mod_name_lower}") | ||
os.rename(f"{script_dir}/{mod_name_lower}/{filename}", f"{script_dir}/{mod_name_lower}/{new_name}") | ||
|
||
|
||
print(f"Готово! Файлы для мода {mod_name_upper} созданы.") | ||
print(f"Находятся они в папке mods/{mod_name_lower}.") | ||
print() | ||
input("Нажмите Enter для закрытия...") |
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,62 @@ | ||
#!/bin/bash | ||
|
||
COLOR_RESET='\033[0m' | ||
COLOR_GREEN='\033[32m' | ||
COLOR_BLUE='\033[36m' | ||
|
||
mod_name="" | ||
mod_name_upper="" | ||
mod_name_lower="" | ||
|
||
script_dir=$(dirname "$0") | ||
|
||
while [ -z "$mod_name" ]; do | ||
echo -e "${COLOR_GREEN}| ${COLOR_RESET}Название мода пишется заглавными буквами, а также с" | ||
echo -e "${COLOR_GREEN}| ${COLOR_RESET}использованием подчёркиваний вместо пробелов или тире." | ||
echo -e "${COLOR_GREEN}| ${COLOR_RESET}Пример: COOKIE_FACTORY" | ||
echo -en "${COLOR_BLUE}> ${COLOR_RESET}Введи название мода: " | ||
read mod_name | ||
echo | ||
|
||
mod_name=$(echo "$mod_name" | sed -E 's/\s|-/_/g') | ||
|
||
mod_name_upper=$(echo "$mod_name" | tr '[:lower:]' '[:upper:]') | ||
mod_name_lower=$(echo "$mod_name" | tr '[:upper:]' '[:lower:]') | ||
|
||
echo -e "${COLOR_GREEN}| ${COLOR_RESET}Выбранное название: ${mod_name_upper} / ${mod_name_lower}" | ||
echo -en "${COLOR_BLUE}> ${COLOR_RESET}Всё верно? (Y/n) " | ||
read confirmation | ||
echo | ||
|
||
confirmation=${confirmation:-y} | ||
if [ "${confirmation,,}" != "y" ]; then | ||
mod_name="" | ||
fi | ||
done | ||
|
||
if [ ! -d "$script_dir/_example" ]; then | ||
echo "Папка mods/_example не найдена. Убедись что она существует и попробуй ещё раз." | ||
exit 1 | ||
fi | ||
|
||
if [ -d "$script_dir/$mod_name_lower" ]; then | ||
echo "Папка mods/$mod_name_lower уже существует." | ||
exit 1 | ||
fi | ||
|
||
mkdir -p "$script_dir/$mod_name_lower" | ||
cp -r "$script_dir/_example/"* "$script_dir/$mod_name_lower/" | ||
|
||
# Rename files | ||
for file in "$script_dir/$mod_name_lower"/*example*; do | ||
new_name=$(echo "$file" | sed -E "s/_example/_$mod_name_lower/") | ||
mv "$file" "$new_name" | ||
done | ||
|
||
# Process and update content of all the files | ||
for file in "$script_dir/$mod_name_lower"/*; do | ||
sed -i'' -e "s/EXAMPLE/$mod_name_upper/g" -e "s/example/$mod_name_lower/g" "$file" | ||
done | ||
|
||
echo "Готово! Файлы для мода $mod_name_upper созданы." | ||
echo "Находятся они в папке mods/$mod_name_lower." |
Oops, something went wrong.