Skip to content

Commit e8fb50c

Browse files
authored
Merge pull request #26 from blueyed/remove-bash
Remove bash
2 parents bd22b38 + 6e443db commit e8fb50c

File tree

5 files changed

+21
-10
lines changed

5 files changed

+21
-10
lines changed

Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
FROM alpine:3.5
22

3-
RUN apk --update add bash \
4-
&& rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
5-
6-
RUN adduser -h /home -s /bin/bash -D -u 8465 vimtest
3+
RUN adduser -h /home -s /bin/sh -D -u 8465 vimtest
74

85
RUN mkdir -p /vim /vim-build/bin /plugins
96
RUN chown vimtest:vimtest /home /plugins

example/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,17 @@ test: test-setup
1515
for vim in $$vims; do \
1616
$(DOCKER) $$vim '+Vader! test/*'; \
1717
done
18+
out=$$(docker run --rm "$(IMAGE)" /vim-build/bin/argecho "arg1" "arg 2"); \
19+
for line in "PWD=/" "Running as: root" "Arguments:" "arg1" "arg 2"; do \
20+
if ! echo "$$out" | grep -qFx -e "$$line"; then \
21+
echo "Line not found: $$line"; echo "$$out"; exit 1; \
22+
fi \
23+
done
24+
out=$$(docker run --rm "$(IMAGE)" argecho "arg1" "arg 2"); \
25+
for line in "Running as: vimtest" "PWD=/testplugin" "Arguments:" "-u" "/home/vimrc" "-i" "NONE" "arg1" "arg 2"; do \
26+
if ! echo "$$out" | grep -qFx -e "$$line"; then \
27+
echo "Line not found: $$line"; echo "$$out"; exit 1; \
28+
fi \
29+
done
1830

1931
.PHONY: test-setup test

scripts/argecho.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

33
echo "Running as: $(whoami)"
44

@@ -9,6 +9,6 @@ env
99
echo
1010
echo "Arguments:"
1111
while [ $# -gt 0 ]; do
12-
echo $1
12+
echo "$1"
1313
shift
1414
done

scripts/install_vim.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

33
set -e
44

@@ -20,6 +20,8 @@ build() {
2020
[ -z $NAME ] && NAME="vim-${TAG}"
2121
[ -z $TAG ] && bail "-tag is required"
2222

23+
apk add ncurses
24+
2325
VIM_NAME="vim_${TAG}_py${PYTHON}_rb${RUBY}_lua${LUA}"
2426
VIM_PATH="/vim-build/$VIM_NAME"
2527
VIM_BIN="$VIM_PATH/bin/vim"

scripts/run_vim.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

33
BIN=$1
44
shift
55

6-
if [ "$BIN" == "bash" ] || [ -z "$BIN" ]; then
7-
exec /bin/bash
6+
if [ "$BIN" = "sh" ] || [ -z "$BIN" ]; then
7+
exec /bin/sh
88
fi
99
if ! [ -x "/vim-build/bin/$BIN" ]; then
1010
exec "$BIN" "$@"

0 commit comments

Comments
 (0)