9
9
# ======================
10
10
11
11
# 1. Default values of arguments
12
- # Arg: -f
12
+ # Arg: -f
13
13
# Determine force download asserts, default is not
14
14
FORCE_DOWNLOAD=false
15
15
@@ -33,10 +33,12 @@ while getopts "fl:-:" opt; do
33
33
-)
34
34
case " ${OPTARG} " in
35
35
lang)
36
- LANGUAGE=" ${! OPTIND} " ; OPTIND=$(( $OPTIND + 1 ))
36
+ LANGUAGE=" ${! OPTIND} "
37
+ OPTIND=$(( $OPTIND + 1 ))
37
38
;;
38
39
url)
39
- SOURCE_URL=" ${! OPTIND} " ; OPTIND=$(( $OPTIND + 1 ))
40
+ SOURCE_URL=" ${! OPTIND} "
41
+ OPTIND=$(( $OPTIND + 1 ))
40
42
;;
41
43
* )
42
44
echo " Usage: $0 [-f] [-l language|--lang language] [--url source]" >&2
@@ -51,7 +53,6 @@ while getopts "fl:-:" opt; do
51
53
esac
52
54
done
53
55
54
-
55
56
# ===============
56
57
# == Variables ==
57
58
# ===============
@@ -161,7 +162,7 @@ show_message() {
161
162
;;
162
163
esac
163
164
;;
164
- esac
165
+ esac
165
166
}
166
167
167
168
# Function to download files
@@ -186,7 +187,7 @@ extract_file() {
186
187
if [ $? -eq 0 ]; then
187
188
echo " $file_name " $( show_message " extracted_success" ) " $target_dir "
188
189
else
189
- echo " $file_name " $( show_message " extracted_failed" )
190
+ echo " $file_name " $( show_message " extracted_failed" )
190
191
exit 1
191
192
fi
192
193
else
@@ -198,30 +199,30 @@ extract_file() {
198
199
# Define colors
199
200
declare -A colors
200
201
colors=(
201
- [black]=" \e[30m"
202
- [red]=" \e[31m"
203
- [green]=" \e[32m"
204
- [yellow]=" \e[33m"
205
- [blue]=" \e[34m"
206
- [magenta]=" \e[35m"
207
- [cyan]=" \e[36m"
208
- [white]=" \e[37m"
209
- [reset]=" \e[0m"
202
+ [black]=" \e[30m"
203
+ [red]=" \e[31m"
204
+ [green]=" \e[32m"
205
+ [yellow]=" \e[33m"
206
+ [blue]=" \e[34m"
207
+ [magenta]=" \e[35m"
208
+ [cyan]=" \e[36m"
209
+ [white]=" \e[37m"
210
+ [reset]=" \e[0m"
210
211
)
211
212
212
213
print_centered () {
213
- local text=" $1 " # Get input texts
214
- local color=" ${2:- reset} " # Get color, default to reset
215
- local term_width=$( tput cols) # Get terminal width
216
- local text_length=${# text} # Get text length
217
- local padding=$(( (term_width - text_length) / 2 )) # Get padding
218
- # Check if the color is valid
219
- if [[ -z " ${colors[$color]} " ]]; then
220
- echo " Invalid color specified. Available colors: ${! colors[@]} "
221
- return 1
222
- fi
223
- # Print the text with padding
224
- printf " %*s${colors[$color]} %s${colors[reset]} \n" $padding " " " $text "
214
+ local text=" $1 " # Get input texts
215
+ local color=" ${2:- reset} " # Get color, default to reset
216
+ local term_width=$( tput cols) # Get terminal width
217
+ local text_length=${# text} # Get text length
218
+ local padding=$(( (term_width - text_length) / 2 )) # Get padding
219
+ # Check if the color is valid
220
+ if [[ -z " ${colors[$color]} " ]]; then
221
+ echo " Invalid color specified. Available colors: ${! colors[@]} "
222
+ return 1
223
+ fi
224
+ # Print the text with padding
225
+ printf " %*s${colors[$color]} %s${colors[reset]} \n" $padding " " " $text "
225
226
}
226
227
227
228
# Download files asynchronously
@@ -236,7 +237,7 @@ rm s3_data.tar.gz
236
237
237
238
# Display final message
238
239
printf " \n%s\n\n" " $( show_message " tips_run_command" ) "
239
- print_centered " docker compose -p lobechat-starter up -d" " green"
240
+ print_centered " docker compose up -d" " green"
240
241
printf " \n%s" " $( show_message " tips_show_documentation" ) "
241
242
printf " %s\n" $( show_message " tips_show_documentation_url" )
242
- printf " \n\e[33m%s\e[0m\n" " $( show_message " tips_warning" ) "
243
+ printf " \n\e[33m%s\e[0m\n" " $( show_message " tips_warning" ) "
0 commit comments