From 289dbf77e32bd44604d6deeb2bd0bc4cb9300e8c Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 25 Jan 2017 12:03:55 -0800 Subject: [PATCH] Fix linux CLI sudo argument parsing Fixes #17713 --- resources/linux/bin/code.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/linux/bin/code.sh b/resources/linux/bin/code.sh index 463a655a4d2..bb146af861f 100755 --- a/resources/linux/bin/code.sh +++ b/resources/linux/bin/code.sh @@ -5,12 +5,11 @@ # If root, ensure that --user-data-dir is specified if [ "$(id -u)" = "0" ]; then - while test $# -gt 0 + for i in $@ do - if [[ $1 == --user-data-dir=* ]]; then + if [[ $i == --user-data-dir=* ]]; then DATA_DIR_SET=1 fi - shift done if [ -z $DATA_DIR_SET ]; then 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