Skip to content

Commit ff5bf66

Browse files
authored
scripts/run_vim.sh: special ARGS handling only with "su" (Vimjas#49)
1 parent 8129dc2 commit ff5bf66

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

scripts/run_vim.sh

+6-7
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,20 @@ fi
1717
# Set default vimrc to a visible file
1818
ARGS="-u /home/vimtest/vimrc -i NONE"
1919

20-
# So we can pass the arguments to Vim as it was passed to this script
21-
while [ $# -gt 0 ]; do
22-
ARGS="$ARGS \"$1\""
23-
shift
24-
done
25-
2620
# Run as the vimtest user (when no USER is specified in the Dockerfile, i.e.
2721
# when running as root).
2822
# This is not really for security. It is for running Vim as a user that's
2923
# unable to write to your volume.
3024
if [ "$(id -u)" = 0 ]; then
25+
# So we can pass the arguments to Vim as it was passed to this script
26+
while [ $# -gt 0 ]; do
27+
ARGS="$ARGS \"$1\""
28+
shift
29+
done
3130
exec su -l vimtest -c "cd /testplugin && /vim-build/bin/$BIN $ARGS"
3231
fi
3332

3433
cd /testplugin || exit
3534

3635
# shellcheck disable=SC2086
37-
exec "/vim-build/bin/$BIN" $ARGS
36+
exec "/vim-build/bin/$BIN" "$@"

0 commit comments

Comments
 (0)