-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathinit
executable file
·63 lines (52 loc) · 1.62 KB
/
init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# functions ---
function message() {
if ! [[ $2 ]]; then
echo -e '\033[1;32m'$1'\033[0m'
else
echo -e '\033[1;32m'$1'\033[1;37m → \033[1;34m'$2'\033[0m'
fi
}
function message-success() {
if ! [[ $2 ]]; then
echo -e '\033[1;33m'$1'\033[0m'
else
echo -e '\033[1;33m'$1'\033[1;37m → \033[1;35m'$2'\033[0m'
fi
}
function addline() {
echo -e '\033[1;36m======================================\033[0m'
}
# --- functions
message "Введите название проекта: "
read name
message "Введите описание проекта: "
read description
addline
echo -e "\n"
# README.md ---
echo -e "# $name\n$description\n" > README.md
echo -e "## Как запустить\n" >> README.md
echo -e "- \`npm i\` - установка зависимостей" >> README.md
echo -e "- \`npm run dev\` - запуск live-server" >> README.md
echo -e "- \`npm run build\` - сборка проекта" >> README.md
echo -e "\n---\n" >> README.md
echo -e "\nДокументация: https://github.com/alexsoin/pepelac" >> README.md
message "Создан файл" "README.md"
# --- README.md
# rm & git init ---
rm ./package-lock.json
rm ./LICENSE
rm -fr .git
git init
message "Инициализирован" "git init"
rm -fr init
# --- rm & git init
# complete ---
echo -e "\n"
addline
message-success " Проект успешно проинициализирован!"
message-success " Не забудьте при необходимости отредактировать содержимое файлов" "index.js, index.scss, variables.scss и index.twig"
addline
echo -e "\n"
# --- complete