You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: resources/linux/bin/code.sh
+21-13Lines changed: 21 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,36 @@
1
-
#!/usr/bin/env bash
1
+
#!/usr/bin/env sh
2
2
#
3
3
# Copyright (c) Microsoft Corporation. All rights reserved.
4
4
# Licensed under the MIT License. See License.txt in the project root for license information.
5
5
6
6
# test that VSCode wasn't installed inside WSL
7
7
if grep -qi Microsoft /proc/version && [ -z"$DONT_PROMPT_WSL_INSTALL" ];then
8
-
echo"To use VS Code with the Windows Subsystem for Linux, please install VS Code in Windows and uninstall the Linux version in WSL. You can then use the '@@PRODNAME@@' command in a WSL terminal just as you would in a normal command prompt."1>&2
9
-
read -e -p "Do you want to continue anyways ? [y/N] " YN
10
-
11
-
[[ $YN=="n"||$YN=="N"||$YN=="" ]] &&exit 1
12
-
echo"To no longer see this prompt, start @@PRODNAME@@ with the environment variable DONT_PROMPT_WSL_INSTALL defined."
8
+
echo"To use @@PRODNAME@@ with the Windows Subsystem for Linux, please install @@PRODNAME@@ in Windows and uninstall the Linux version in WSL. You can then use the \`@@NAME@@\` command in a WSL terminal just as you would in a normal command prompt."1>&2
9
+
printf"Do you want to continue anyway? [y/N] "1>&2
10
+
read -r YN
11
+
YN=$(printf '%s'"$YN"| tr '[:upper:]''[:lower:]')
12
+
case"$YN"in
13
+
y | yes )
14
+
;;
15
+
* )
16
+
exit 1
17
+
;;
18
+
esac
19
+
echo"To no longer see this prompt, start @@PRODNAME@@ with the environment variable DONT_PROMPT_WSL_INSTALL defined."1>&2
13
20
fi
14
21
15
-
16
22
# If root, ensure that --user-data-dir or --file-write is specified
17
23
if [ "$(id -u)"="0" ];then
18
-
foriin$@
24
+
foriin"$@"
19
25
do
20
-
if [[ $i== --user-data-dir ||$i== --user-data-dir=*||$i== --file-write ]];then
echo"You are trying to start vscode as a super user which is not recommended. If you really want to, you must specify an alternate user data directory using the --user-data-dir argument."1>&2
33
+
echo"You are trying to start @@PRODNAME@@ as a super user which isn't recommended. If this was intended, please specify an alternate user data directory using the \`--user-data-dir\` argument."1>&2
26
34
exit 1
27
35
fi
28
36
fi
@@ -33,7 +41,7 @@ if [ ! -L "$0" ]; then
33
41
else
34
42
ifcommand -v readlink >/dev/null;then
35
43
# if readlink exists, follow the symlink and find relatively
0 commit comments