Skip to content

Commit 642fbe8

Browse files
committed
style: fix some lint issues
1 parent a58228c commit 642fbe8

File tree

2 files changed

+29
-23
lines changed

2 files changed

+29
-23
lines changed

bin/_helpers

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,24 @@ if test -t 1; then
2727
COLOR_C=6 # color code - CYAN
2828
COLOR_N=246 # color code - NEUTRAL (GRAY)
2929

30-
BG_R="$(tput setab $COLOR_R)" # Background - RED
31-
BG_G="$(tput setab $COLOR_G)" # Background - GREEN
32-
BG_Y="$(tput setab $COLOR_Y)" # Background - YELLOW
33-
BG_B="$(tput setab $COLOR_B)" # Background - BLUE
34-
#BG_M="$(tput setab $COLOR_M)" # Background - MAGENTA
35-
#BG_C="$(tput setab $COLOR_C)" # Background - CYAN
36-
BG_N="$(tput setab $COLOR_N)" # Background - NEUTRAL (GRAY)
30+
export BG_R="$(tput setab $COLOR_R)" # Background - RED
31+
export BG_G="$(tput setab $COLOR_G)" # Background - GREEN
32+
export BG_Y="$(tput setab $COLOR_Y)" # Background - YELLOW
33+
export BG_B="$(tput setab $COLOR_B)" # Background - BLUE
34+
export BG_M="$(tput setab $COLOR_M)" # Background - MAGENTA
35+
export BG_C="$(tput setab $COLOR_C)" # Background - CYAN
36+
export BG_N="$(tput setab $COLOR_N)" # Background - NEUTRAL (GRAY)
3737

38-
#FG_R="$(tput setaf $COLOR_R)" # Foreground - RED
39-
#FG_G="$(tput setaf $COLOR_G)" # Foreground - GREEN
40-
#FG_Y="$(tput setaf $COLOR_Y)" # Foreground - YELLOW
41-
#FG_B="$(tput setaf $COLOR_B)" # Foreground - BLUE
42-
FG_M="$(tput setaf $COLOR_M)" # Foreground - MAGENTA
43-
FG_C="$(tput setaf $COLOR_C)" # Foreground - CYAN
44-
FG_N="$(tput setaf $COLOR_N)" # Foreground - NEUTRAL (GRAY)
38+
export FG_R="$(tput setaf $COLOR_R)" # Foreground - RED
39+
export FG_G="$(tput setaf $COLOR_G)" # Foreground - GREEN
40+
export FG_Y="$(tput setaf $COLOR_Y)" # Foreground - YELLOW
41+
export FG_B="$(tput setaf $COLOR_B)" # Foreground - BLUE
42+
export FG_M="$(tput setaf $COLOR_M)" # Foreground - MAGENTA
43+
export FG_C="$(tput setaf $COLOR_C)" # Foreground - CYAN
44+
export FG_N="$(tput setaf $COLOR_N)" # Foreground - NEUTRAL (GRAY)
4545

46-
BOLD="$(tput bold)"
47-
RESET="$(tput sgr0)"
46+
export BOLD="$(tput bold)"
47+
export RESET="$(tput sgr0)"
4848
fi
4949
fi
5050

bin/proxy

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ function parse_arg() {
5151
local key=$1
5252
local value=$2
5353

54-
if [ "$2" ]; then
55-
echo "$2"
54+
if [ "$value" ]; then
55+
echo "$value"
5656
else
5757
output_error "'${key}' requires a non-empty argument."
5858
exit 1
@@ -136,15 +136,17 @@ function pick_one_virtual_host_from_file() {
136136
local FILE=$1
137137
local EXCEPT=$2
138138

139-
local HOST_STRING=$(sed -nr 's/.*VIRTUAL_HOST=(.*)/\1/p' $FILE)
139+
local HOST_STRING
140140
local HOSTS
141141
local HOST
142142

143+
HOST_STRING=$(sed -nr 's/.*VIRTUAL_HOST=(.*)/\1/p' $FILE)
144+
143145
IFS="," read -ra HOSTS <<< "$HOST_STRING"
144146

145147
for HOST_ENTRY in "${HOSTS[@]}"; do
146148
if [ "$HOST_ENTRY" != "$EXCEPT" ]; then
147-
echo $HOST_ENTRY
149+
HOST=$HOST_ENTRY
148150
break;
149151
fi
150152
done
@@ -153,6 +155,8 @@ function pick_one_virtual_host_from_file() {
153155
output_error "No VIRTUAL_HOST found in $FILE."
154156
exit 1
155157
fi
158+
159+
echo $HOST
156160
}
157161

158162
function determine_virtual_host() {
@@ -161,7 +165,8 @@ function determine_virtual_host() {
161165
exit 1
162166
fi
163167

164-
local HOST=$(pick_one_virtual_host_from_file $DOCKER_FILE)
168+
local HOST
169+
HOST=$(pick_one_virtual_host_from_file $DOCKER_FILE)
165170

166171
if [ $? -ne 0 ]; then
167172
echo $HOST
@@ -182,7 +187,8 @@ function determine_virtual_host_override() {
182187
exit 1
183188
fi
184189

185-
local HOST=$(pick_one_virtual_host_from_file $DOCKER_FILE_OVERRIDE $1)
190+
local HOST
191+
HOST=$(pick_one_virtual_host_from_file $DOCKER_FILE_OVERRIDE $1)
186192

187193
if [ $? -ne 0 ]; then
188194
echo $HOST
@@ -224,4 +230,4 @@ output_info "Starting proxy... $FG_C${LOCAL_DOMAIN}$FG_N:$FG_M${LOCAL_PORT}$RESE
224230
echo
225231
output_tagged_string "$BG_N" "Proxy URL" "https://$PROXY_DOMAIN"
226232
echo
227-
ssh -tR ${PROXY_PORT}:${LOCAL_DOMAIN}:${LOCAL_PORT} [email protected] sirtunnel.py ${PROXY_DOMAIN} ${PROXY_PORT}
233+
ssh -tR "${PROXY_PORT}:${LOCAL_DOMAIN}:${LOCAL_PORT}" [email protected] sirtunnel.py "${PROXY_DOMAIN}" "${PROXY_PORT}"

0 commit comments

Comments
 (0)