@wjwjq/release-helper 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/.release/doc//351/203/250/347/275/262/346/211/213/345/206/214.md +3 -19
  2. package/dist/.release/release.conf.yaml +2 -0
  3. package/dist/cli.js +1 -1
  4. package/dist/deploy/pkg/nginx/nginx.logrotate.tpl +14 -0
  5. package/dist/deploy/script/common.sh +36 -28
  6. package/dist/deploy/script/nginx.sh +29 -20
  7. package/dist/deploy/script/prompt.sh +6 -0
  8. package/dist/pack.js +2 -1
  9. package/dist/prepare.js +14 -4
  10. package/dist/start_prepare.js +1 -1
  11. package/package.json +2 -2
  12. package/src/.release/README.md +0 -73
  13. package/src/.release/doc//351/203/250/347/275/262/346/211/213/345/206/214.md +0 -434
  14. package/src/.release/nginx/ca/ca.crt +0 -32
  15. package/src/.release/nginx/ca/ca.key +0 -54
  16. package/src/.release/nginx/ca/client.crt +0 -100
  17. package/src/.release/nginx/ca/client.csr +0 -16
  18. package/src/.release/nginx/ca/client.p12 +0 -0
  19. package/src/.release/nginx/ca/client.pem +0 -30
  20. package/src/.release/nginx/ca/server.crt +0 -101
  21. package/src/.release/nginx/ca/server.csr +0 -17
  22. package/src/.release/nginx/ca/server.key +0 -27
  23. package/src/.release/nginx/ca/server.pem +0 -30
  24. package/src/.release/nginx/nginx.conf +0 -179
  25. package/src/.release/release.conf.yaml +0 -15
  26. package/src/cli.ts +0 -99
  27. package/src/deploy/pkg/nginx/nginx.service.tpl +0 -32
  28. package/src/deploy/pkg/nginx_binary/compile.sh +0 -39
  29. package/src/deploy/pkg/nginx_binary/nginx-arm-ssl1.1.1.tar.gz +0 -0
  30. package/src/deploy/pkg/nginx_binary/nginx-x86_64-ssl1.0.2.tar.gz +0 -0
  31. package/src/deploy/pkg/nginx_binary/nginx-x86_64-ssl1.1.1.tar.gz +0 -0
  32. package/src/deploy/pkg/nginx_binary/nginx-x86_64-ssl3.0.7.tar.gz +0 -0
  33. package/src/deploy/script/common.sh +0 -195
  34. package/src/deploy/script/install.sh +0 -7
  35. package/src/deploy/script/nginx.sh +0 -256
  36. package/src/deploy/script/prompt.sh +0 -110
  37. package/src/deploy/script/readme.md +0 -10
  38. package/src/deploy/script/upgrade.sh +0 -7
  39. package/src/logger.ts +0 -18
  40. package/src/pack.ts +0 -152
  41. package/src/prepare.ts +0 -120
  42. package/src/publish.ts +0 -308
  43. package/src/release.ts +0 -292
  44. package/src/start_prepare.ts +0 -13
@@ -1,195 +0,0 @@
1
- #!/bin/bash
2
- # 获取脚本的父目录
3
- project_path=$(echo "$basepath" | sed -e "s/\/script//")
4
-
5
- # 请勿修改此处, 此处将在打包时自动替换
6
- app_name=__APP_NAME__
7
-
8
- # 静态资源存放目录 eg: /opt/posidon-frontend/
9
- install_path=__INSTALL_PATH__
10
- user=__USER__
11
- usergroup=__USER_GROUP__
12
-
13
- execute_log_path="/var/log/${app_name}_script_execute_logs"
14
-
15
- log() {
16
- now=$(date "+%Y-%m-%d %H:%M:%S")
17
- echo "$now: $1"
18
- echo "$now: [info] $1" >>"$execute_log_path"
19
- }
20
-
21
- log_success() {
22
- now=$(date "+%Y-%m-%d %H:%M:%S")
23
- echo "$(tput setaf 2)""$now": "$1""$(tput sgr0)"
24
- echo "$now: [success] $1" >>"$execute_log_path"
25
- }
26
-
27
- log_error() {
28
- now=$(date "+%Y-%m-%d %H:%M:%S")
29
- echo "$(tput setaf 1)""$now": "$1" "$(tput sgr0)"
30
- echo "$now: [error] $1" >>"$execute_log_path"
31
- }
32
-
33
- log "-----------execute ${app_name} script-------------"
34
-
35
- source "$basepath"/prompt.sh
36
-
37
- if [[ $(whoami) != "root" ]]; then
38
- echo "user:root is required!"
39
- exit 1
40
- fi
41
-
42
- if [[ -z "${install_path}" ]]; then
43
- echo "install path not found"
44
- exit 1
45
- fi
46
-
47
- echo "install_path: ${install_path}"
48
-
49
- source "$basepath"/nginx.sh
50
-
51
- # 创建用户
52
- create_user_csri() {
53
- user=$user
54
- group=$usergroup
55
-
56
- #create group if not exists
57
- grep "^$group" /etc/group >&/dev/null
58
- if [ $? -ne 0 ]; then
59
- groupadd $group
60
- fi
61
-
62
- #create user if not exists
63
- grep "^$user" /etc/passwd >&/dev/null
64
- if [ $? -ne 0 ]; then
65
- useradd -g $group $user
66
- fi
67
- }
68
-
69
- has_nginx_installed=1
70
-
71
- # 检查 nginx 是否已安装
72
- if command -v nginx >/dev/null 2>&1; then
73
- # echo "Nginx is installed."
74
- has_nginx_installed=1
75
- # # 检查 nginx 服务是否正在运行
76
- # if pgrep nginx >/dev/null 2>&1; then
77
- # echo "Nginx is running."
78
- # else
79
- # echo "Nginx is installed but not running."
80
- # fi
81
- else
82
- # echo "Nginx is not installed."
83
- has_nginx_installed=0
84
- fi
85
-
86
- get_old_version() {
87
- if [ -f "$install_path""version" ]; then
88
- old_version=$(sed -n '1p' "$install_path""version")
89
-
90
- echo "$old_version"
91
- fi
92
- }
93
-
94
- install_assets() {
95
-
96
- # 拷贝静态资源
97
- cp -rf "${project_path}"/pkg/version "$install_path"
98
-
99
- mkdir -p "$install_path"assets
100
-
101
- cp -rf "${project_path}"/pkg/assets/* "$install_path"assets
102
-
103
- # # 对比行数并合并
104
- # if [ -f "${backup_path}/settings" ]; then
105
- # cat $backup_path/settings | sed '/^$/d' >>./settings
106
- # cat $install_path/settings | sed '/^$/d' >>./settings_new
107
-
108
- # diffLines=$(diff ./settings ./settings_new | awk 'END{print NR}')
109
-
110
- # if ((diffLines > 0)); then
111
- # echo '-------合并前:old--------'
112
- # cat ./settings
113
- # old_total_line=$(awk 'END{print NR}' ./settings)
114
- # start=$(($old_total_line + 1))
115
-
116
- # echo '-------合并前: new--------'
117
- # cat ./settings_new
118
- # total_line=$(awk 'END{print NR}' ./settings_new)
119
-
120
- # sed -n "${start},${total_line}p" ./settings_new >>./settings
121
- # echo '---------- 合并后 ----------'
122
- # cat ./settings
123
-
124
- # mv -f ./settings $install_path
125
- # rm -rf ./settings_new
126
-
127
- # echo "$(tput setaf 2)"settings 已合并,注意检查"$(tput sgr0)"
128
- # fi
129
- # fi
130
-
131
- log_success "$install_path"assets/settings 已覆盖,请注意对比差异
132
-
133
- }
134
-
135
- start() {
136
- # 未安装
137
- if ((has_nginx_installed == 0)); then
138
- install_nginx_binary
139
-
140
- if [[ $? != 0 ]]; then
141
- echo "$(tput setaf 1)"failed to install!"$(tput sgr0)"
142
- exit 1
143
- fi
144
- fi
145
-
146
- # 已安装 询问是否更新nginx
147
- if ((has_nginx_installed == 1)); then
148
- while true; do
149
- read -r -p "Nginx has been installed, re-install it?[Y/N]" yn
150
- case $yn in
151
- [Yy]*)
152
- install_nginx_binary
153
-
154
- if [[ $? != 0 ]]; then
155
- echo "$(tput setaf 1)"failed to install!"$(tput sgr0)"
156
- exit 1
157
- fi
158
- break
159
- ;;
160
- [Nn]*) break ;;
161
- *) echo "Please answer yes or no." ;;
162
- esac
163
- done
164
- fi
165
-
166
- # 创建用户
167
- create_user_csri
168
-
169
- now=$(date "+%Y-%m-%d_%H:%M:%S")
170
- old_version=$(get_old_version)
171
-
172
- #备份整个服务 eg: /opt/posidon-frontend
173
- if [[ -n "${old_version}" ]]; then
174
- parent_store_path=$(echo "$install_path" | sed -e "s/\/${app_name}//")
175
- backup_path=$parent_store_path""$app_name"_"$old_version"_"$now
176
- echo "${app_name} assets backup at: $backup_path"
177
- mv "$install_path" "$backup_path"
178
- fi
179
-
180
- mkdir -p "$install_path"
181
-
182
- copy_nginx_conf_and_write_verison
183
- add_nginx_service
184
- install_assets
185
-
186
- # 修改所属用户
187
- chown -R $user:$usergroup "$install_path"
188
- chmod 744 -R "$install_path"
189
-
190
- if [[ $? == 0 ]]; then
191
- log_success "posidon-frontend deployed successfully"
192
- else
193
- log_error "posidon-frontend deployment failed"
194
- fi
195
- }
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- # 获取脚本所在的目录
3
- basepath=$(dirname "$(realpath "${BASH_SOURCE[-1]}")")
4
-
5
- source "$basepath"/common.sh
6
-
7
- start
@@ -1,256 +0,0 @@
1
- #!/bin/bash
2
-
3
- # 安装包所在路径
4
- pkg_path="${project_path}/pkg"
5
-
6
- #------------------------------------ nginx服务配置文件服务 start----------------------------------
7
- # 配置文件所在路径
8
- new_nginx_conf_path="${pkg_path}/nginx"
9
-
10
- # 指定安装目录
11
- nginx_conf_install_path="$prefix/opt/${app_name}/nginx/"
12
-
13
- # nginx服务配置文件路径
14
- nginx_conf_path="${nginx_conf_install_path}nginx.conf"
15
-
16
- # asset_path="$prefix/opt/posidon-frontend/"
17
- nginx_log_path="/var/log/nginx"
18
- nginx_log_file="${app_name}.nginx.log"
19
- #不放在var/run 是因为重启后 var/run/下面的文件及目录会被清除
20
- nginx_pid_dir="/var/log/nginx/"
21
- nginx_pid_file_path="$nginx_pid_dir${app_name}.nginx.pid"
22
-
23
- conf_version=$(awk '{print $1}' "${pkg_path}"/version)
24
- echo "$conf_version"
25
-
26
- copy_nginx_conf_and_write_verison() {
27
- mkdir -p "$nginx_conf_install_path"
28
- # 创建pid目录
29
- mkdir -p $nginx_pid_dir
30
- chown -R $user:$usergroup $nginx_pid_dir
31
- chmod 744 -R $nginx_pid_dir
32
-
33
- # 创建日志目录
34
- mkdir -p $nginx_log_path
35
- touch $nginx_log_path/$nginx_log_file
36
- chown -R $user:$usergroup $nginx_log_path
37
- chmod 744 -R $nginx_log_path
38
-
39
- access_log_super="access_log /dev/stdout main"
40
- error_log_super="error_log /dev/stderr warn"
41
- access_log="access_log $nginx_log_path/$nginx_log_file main"
42
- error_log="error_log $nginx_log_path/$nginx_log_file"
43
- pid_file="pid $nginx_pid_file_path"
44
-
45
- exec=$(get_exec_path)
46
-
47
- # if [ -f "$nginx_conf_path" ]; then
48
- # old_version=$(sed -n '1p' "$nginx_conf_path" | sed 's/# version: //' | sed "s/\s\+//g")
49
-
50
- # if [[ -n "${old_version}" ]]; then
51
- # now=$(date "+%Y-%m-%d_%H:%M:%S")
52
-
53
- # # echo "nginx_"$old_version"_"$now".conf"
54
- # mv "$nginx_conf_path" "${nginx_conf_install_path}"/"$app_name".nginx_"$old_version"_"$now".conf
55
- # fi
56
- # fi
57
-
58
- #nginx -v nginx代码内部使用的stderr输出, 此处需要转换为stdout
59
- nginx_version=$($exec -v 2>&1)
60
-
61
- tmp_file='./nginx/nginx.conf'
62
- cp -rf "$new_nginx_conf_path" ./
63
-
64
- sed -i "1i\# ${nginx_version}" $tmp_file
65
- sed -i "1i\# version: ${conf_version}" $tmp_file
66
-
67
- if [[ -n "${prefix}" ]]; then
68
- n=$(grep -wn "mime.types" $tmp_file | awk -F: '{print $1}' | sed -n 1p)
69
- sed -i "${n}c include conf/mime.types;" $tmp_file
70
- fi
71
-
72
- # n=$(grep -wn "__root__" $tmp_file | awk -F: '{print $1}' | sed -n 1p)
73
- # if [[ -n "${n}" ]]; then
74
- # sed -i "${n}c root ${asset_path};" $tmp_file
75
- # fi
76
-
77
- # 替换日志输出路径方式
78
- n=$(grep -wn "#ERROR_LOG_PLACEHOLDER" $tmp_file | awk -F: '{print $1}' | sed -n 1p)
79
- if [[ -n "${n}" ]]; then
80
- sed -i "${n}c ${error_log};" $tmp_file
81
- # if ((mode == 2)); then
82
- # sed -i "${n}c ${error_log};" $tmp_file
83
- # else
84
- # sed -i "${n}c ${error_log_super};" $tmp_file
85
- # fi
86
- fi
87
-
88
- n=$(grep -wn "#ACCESS_LOG_PLACEHOLDER" $tmp_file | awk -F: '{print $1}' | sed -n 1p)
89
- if [[ -n "${n}" ]]; then
90
- sed -i "${n}c ${access_log};" $tmp_file
91
- # if ((mode == 2)); then
92
- # sed -i "${n}c ${access_log};" $tmp_file
93
- # else
94
- # sed -i "${n}c ${access_log_super};" $tmp_file
95
- # fi
96
- fi
97
-
98
- n=$(grep -wn "#PID_FILE_PALCEHOLDER" $tmp_file | awk -F: '{print $1}' | sed -n 1p)
99
- if [[ -n "${n}" ]]; then
100
- sed -i "${n}c ${pid_file};" $tmp_file
101
- # 非supervisorctl
102
- # if ((mode == 2)); then
103
- # sed -i "${n}c ${pid_file};" $tmp_file
104
- # fi
105
- fi
106
-
107
- n=$(grep -wn "daemon off;" $tmp_file | awk -F: '{print $1}' | sed -n 1p)
108
- if [[ -n "${n}" ]]; then
109
- # 非supervisorctl
110
- if ((mode == 2)); then
111
- sed -i "${n}c daemon on;" $tmp_file
112
- fi
113
- fi
114
-
115
- # 拷贝整个nginx目录
116
- mv -fb ./nginx/* "$nginx_conf_install_path"
117
-
118
- mkdir -p /data/command/
119
- log "nginx start command: $(get_exec_cmd)"
120
- echo "$exec -c $nginx_conf_path" >/data/command/nginx
121
-
122
- if [[ $? == 0 ]]; then
123
- log_success "$conf_version $nginx_conf_path replaced successfully!"
124
- else
125
- log_error "$conf_version $nginx_conf_path replaced failed!"
126
- fi
127
- }
128
-
129
- get_exec_path() {
130
- cmd=''
131
- if [[ -n "${prefix}" ]]; then
132
- cmd="${nginx_conf_install_path}/sbin/nginx"
133
- else
134
- cmd="/usr/sbin/nginx"
135
- fi
136
-
137
- echo "$cmd"
138
- }
139
-
140
- get_exec_cmd() {
141
- exec=$(get_exec_path)
142
-
143
- echo "$exec -c $nginx_conf_path"
144
- }
145
-
146
- add_nginx_service() {
147
- #添加到服务
148
- exec_cmd="$(get_exec_cmd) -e $nginx_log_path/$nginx_log_file"
149
- cp "$pkg_path"/nginx/nginx.service.tpl ./nginx.service
150
-
151
- check_cmd="$exec -t -c $nginx_conf_path -e $nginx_log_path/$nginx_log_file"
152
- version=$(echo "$conf_version" | grep -oP '\d+\.\d+\.\d+')
153
-
154
- sed -i "s#_user_group_#$usergroup#g" ./nginx.service
155
- sed -i "s#_user_#$user#g" ./nginx.service
156
- sed -i "s#_exec_cmd_#$exec_cmd #g" ./nginx.service
157
- sed -i "s#_log_path_#$nginx_log_path#g" ./nginx.service
158
- sed -i "s#_log_file_#$nginx_log_file#g" ./nginx.service
159
- sed -i "s#_conf_path_#$nginx_conf_path#g" ./nginx.service
160
- sed -i "s#_version_#$version#g" ./nginx.service
161
- sed -i "s#_pid_file_#$nginx_pid_file_path#g" ./nginx.service
162
- #sed -i "s#_start_check_#$check_cmd#g" ./nginx.service
163
-
164
- if ((mode == 2)); then
165
- # systemctl enable nginx
166
- cp ./nginx.service /usr/lib/systemd/system/"$app_name".nginx.service
167
- systemctl daemon-reload
168
-
169
- log_success "add ${app_name}.nginx.service to /usr/lib/systemd/system/"
170
- else
171
- rm -rf /usr/lib/systemd/system/"$app_name".nginx.service
172
- fi
173
- }
174
- #------------------------------------ nginx服务配置文件服务 end----------------------------------
175
-
176
-
177
- #------------------------------------ nginx 可执行程序相关 start----------------------------------
178
- # 指定安装目录
179
- nginx_binary_install_path="/etc/nginx/"
180
-
181
- mkdir -p "$nginx_binary_install_path"
182
-
183
- # 安装包所在路径
184
- nginx_binary_pkg_path="${pkg_path}/nginx_binary"
185
-
186
- open_port_80() {
187
- # 查看防火墙是否开启
188
- systemctl status firewalld
189
- # 若未开启则开启
190
- systemctl start firewalld
191
-
192
- # 查看所有开启的端口
193
- #firewall-cmd --list-ports
194
-
195
- # 开启nginx默认80端口(关键步骤一)
196
- firewall-cmd --zone=public --add-port=80/tcp --permanent
197
-
198
- # 重启防火墙(关键步骤二)
199
- firewall-cmd --reload
200
- }
201
-
202
- # 安装nginx可执行程序
203
- install_nginx_binary() {
204
- log "install nginx to path: ${nginx_binary_install_path}"
205
-
206
- arch=$(uname -m)
207
- ssl_version=$(openssl version | grep -oP '\d+\.\d+' | sed -n '1p' 2>&1)
208
-
209
- if [[ -z "${arch}" ]]; then
210
- arch="x86_64"
211
- fi
212
-
213
- if [[ $arch == arm* ]] || [[ $arch = aarch64 ]]; then
214
- arch="arm"
215
- fi
216
-
217
- if [[ "${ssl_version}" == "1.0" ]]; then
218
- ssl_version="1.0.2"
219
- fi
220
-
221
- if [[ "${ssl_version}" == "1.1" ]]; then
222
- ssl_version="1.1.1"
223
- fi
224
-
225
- if [[ "${ssl_version}" == "3.0" ]]; then
226
- ssl_version="3.0.7"
227
- fi
228
-
229
- if [[ -z "${ssl_version}" ]]; then
230
- ssl_version="1.0.2"
231
- fi
232
-
233
- pkg="$nginx_binary_pkg_path"/nginx-"$arch"-ssl"$ssl_version".tar.gz
234
-
235
- if [ ! -f "$pkg" ]; then
236
- log_error "Fatal error: nginx-$arch-ssl$ssl_version.tar.gz not matched! contact developer!"
237
- exit 1
238
- fi
239
-
240
- log "current arch: $arch, current ssl_version: $ssl_version"
241
-
242
- tar -zxvhf "$pkg" -C "$nginx_binary_install_path" --strip-components 1
243
- # 检测是否安装成功
244
- if [[ $? == 0 ]]; then
245
- log_success "nginx installation successfully!"
246
- else
247
- log_error "nginx installation failed!"
248
- fi
249
-
250
- cp "$nginx_binary_install_path"sbin/nginx /usr/sbin/
251
-
252
- # 修改/etc/nginx 用户(组)
253
- chown -R $user:$usergroup "$nginx_binary_install_path"
254
- chmod 744 -R "$nginx_binary_install_path"
255
- }
256
- #------------------------------------ nginx 可执行程序相关 end ----------------------------------
@@ -1,110 +0,0 @@
1
- #!/bin/bash
2
- log "-----------receive parameter: $@------------"
3
-
4
- # if [ $# == 0 ]; then
5
- # log_error "Fatal error: parameter -standalone or -cluster is required!"
6
- # exit 1
7
- # fi
8
-
9
- mode="__INSTALL_MODE__"
10
-
11
- if [[ "${mode}" == "standalone" ]]; then
12
- mode=1
13
- elif [[ "${mode}" == "cluster" ]]; then
14
- mode=2
15
- else
16
- mode=''
17
- fi
18
-
19
-
20
- if [[ -z "${mode}" ]]; then
21
- while [ $# -gt 0 ]; do
22
- case "$1" in
23
- -S | -standalone)
24
- mode=1
25
- shift
26
- ;;
27
- -C | -cluster)
28
- mode=2
29
- shift
30
- ;;
31
- -h | --help)
32
- echo "supported parameters: "
33
- echo "-S, -standalone install for supervisord startup mode, conflict with -C"
34
- echo "-C, -cluster install for systemd startup mode, conflict with -S"
35
- echo "-P, -prefix specify the install path"
36
- exit 0
37
- ;;
38
- -P | -prefix)
39
- case "$2" in
40
- "")
41
- if [ $# -eq 1 ]; then
42
- break
43
- else
44
- shift 2
45
- fi
46
- ;;
47
- -*) shift ;;
48
- *)
49
- prefix=$2
50
- if [ $# -eq 2 ]; then
51
- break
52
- else
53
- shift 2
54
- fi
55
- ;;
56
- esac
57
- ;;
58
- --)
59
- shift
60
- break
61
- ;;
62
- "")
63
- echo 'no args'
64
- break
65
- ;;
66
- *)
67
- log_error "invalid parameter: {$1}"
68
- exit 1
69
- ;;
70
- esac
71
- done
72
- fi
73
-
74
- if [[ -z "${mode}" ]]; then
75
- log_error "Fatal error: parameter -standalone or -cluster is required!"
76
- exit 1
77
- # echo "Please choose an redis installation mode!"
78
- # PS3='Please input the number: '
79
- # options=("Standalone 1" "Cluster 2" "Quit")
80
- # select opt in "${options[@]}"; do
81
- # case $opt in
82
- # "Standalone 1")
83
- # mode=1
84
- # break
85
- # ;;
86
- # "Cluster 2")
87
- # mode=2
88
- # break
89
- # ;;
90
- # "Quit")
91
- # break
92
- # ;;
93
- # *) echo "invalid option $REPLY" ;;
94
- # esac
95
- # done
96
- fi
97
-
98
- if ((mode == 1)); then
99
- log "-------------------------------------------------"
100
- log "-------start to install Standalone mode-------"
101
- log "-------------------------------------------------"
102
- fi
103
-
104
- if ((mode == 2)); then
105
- log "-------------------------------------------------"
106
- log "-------start to install Cluster mode-------"
107
- log "-------------------------------------------------"
108
- fi
109
-
110
- # echo "install/upgrade prefix: $prefix"
@@ -1,10 +0,0 @@
1
-
2
- nginx
3
- Install
4
- --> 选择mode
5
- -> 检测nginx是否有可执行文件,
6
- a. 若无 --> 安装
7
- b. 若有 --> 询问是否替换安装
8
- --> 资源部署
9
- 1. 生成对应 xxx.nginx.conf (替换对应日志xxx.nginx.log、进程和生成 xxx.nginx.service)
10
- 2. 复制静态资源文件
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- # 获取脚本所在的目录
3
- basepath=$(dirname "$(realpath "${BASH_SOURCE[-1]}")")
4
-
5
- source "$basepath"/common.sh
6
-
7
- start
package/src/logger.ts DELETED
@@ -1,18 +0,0 @@
1
- import pc from 'picocolors';
2
-
3
- export const logger = {
4
- info: (msg: string) => {
5
- console.info(`---------------------- ${msg} ----------------------`)
6
- },
7
- error: (msg: string) => {
8
- console.log(`---------------------- ${pc.red(msg)} ----------------------`)
9
- },
10
- success: (msg: string) => {
11
- console.info("--------------------------------------------------------------");
12
- console.info(`---------🚀 ${pc.green(msg)} ----------------`);
13
- console.info("--------------------------------------------------------------");
14
- },
15
- tip: (msg: string) => {
16
- console.log(`---------------------- ${pc.yellow(msg)} ----------------------`)
17
- }
18
- }