Skip to content

Commit 30abced

Browse files
authored
install_vim.sh: refactor initializing vars (#6)
1 parent 3644952 commit 30abced

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

scripts/install_vim.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ bail() {
77
exit 1
88
}
99

10-
11-
TAG=""
12-
NAME=""
13-
PYTHON=0
14-
RUBY=0
15-
LUA=0
10+
init_vars() {
11+
TAG=
12+
NAME=
13+
PYTHON=0
14+
RUBY=0
15+
LUA=0
16+
}
1617

1718
build() {
1819
[ -z $NAME ] && NAME="vim-${TAG}"
@@ -74,6 +75,7 @@ build() {
7475

7576
apk update
7677

78+
init_vars
7779
while [ $# -gt 0 ]; do
7880
case $1 in
7981
-name)
@@ -106,11 +108,7 @@ while [ $# -gt 0 ]; do
106108
# installing all Vim versions becomes one layer.
107109
# Side note: tried docker-squash and it didn't seem to do anything.
108110
build
109-
NAME=""
110-
TAG=""
111-
PYTHON=0
112-
RUBY=0
113-
LUA=0
111+
init_vars
114112
;;
115113
esac
116114

0 commit comments

Comments
 (0)