Skip to content

Commit 289dbf7

Browse files
committed
Fix linux CLI sudo argument parsing
Fixes #17713
1 parent 53ef9ca commit 289dbf7

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

resources/linux/bin/code.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55

66
# If root, ensure that --user-data-dir is specified
77
if [ "$(id -u)" = "0" ]; then
8-
while test $# -gt 0
8+
for i in $@
99
do
10-
if [[ $1 == --user-data-dir=* ]]; then
10+
if [[ $i == --user-data-dir=* ]]; then
1111
DATA_DIR_SET=1
1212
fi
13-
shift
1413
done
1514
if [ -z $DATA_DIR_SET ]; then
1615
echo "It is recommended to start vscode as a normal user. To run as root, you must specify an alternate user data directory with the --user-data-dir argument." 1>&2

0 commit comments

Comments
 (0)