mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 09:35:37 -05:00
Merge from vscode 2cd495805cf99b31b6926f08ff4348124b2cf73d
This commit is contained in:
committed by
AzureDataStudio
parent
a8a7559229
commit
1388493cc1
@@ -1,28 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env sh
|
||||
#
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
|
||||
# test that VSCode wasn't installed inside WSL
|
||||
if grep -qi Microsoft /proc/version && [ -z "$DONT_PROMPT_WSL_INSTALL" ]; then
|
||||
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
|
||||
read -e -p "Do you want to continue anyways ? [y/N] " YN
|
||||
|
||||
[[ $YN == "n" || $YN == "N" || $YN == "" ]] && exit 1
|
||||
echo "To no longer see this prompt, start @@PRODNAME@@ with the environment variable DONT_PROMPT_WSL_INSTALL defined."
|
||||
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
|
||||
printf "Do you want to continue anyway? [y/N] " 1>&2
|
||||
read -r YN
|
||||
YN=$(printf '%s' "$YN" | tr '[:upper:]' '[:lower:]')
|
||||
case "$YN" in
|
||||
y | yes )
|
||||
;;
|
||||
* )
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
echo "To no longer see this prompt, start @@PRODNAME@@ with the environment variable DONT_PROMPT_WSL_INSTALL defined." 1>&2
|
||||
fi
|
||||
|
||||
|
||||
# If root, ensure that --user-data-dir or --file-write is specified
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
for i in $@
|
||||
for i in "$@"
|
||||
do
|
||||
if [[ $i == --user-data-dir || $i == --user-data-dir=* || $i == --file-write ]]; then
|
||||
CAN_LAUNCH_AS_ROOT=1
|
||||
fi
|
||||
case "$i" in
|
||||
--user-data-dir | --user-data-dir=* | --file-write )
|
||||
CAN_LAUNCH_AS_ROOT=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ -z $CAN_LAUNCH_AS_ROOT ]; then
|
||||
echo "You are trying to start Azure Data Studio 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
|
||||
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
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@@ -33,7 +41,7 @@ if [ ! -L "$0" ]; then
|
||||
else
|
||||
if command -v readlink >/dev/null; then
|
||||
# if readlink exists, follow the symlink and find relatively
|
||||
VSCODE_PATH="$(dirname $(readlink -f "$0"))/.."
|
||||
VSCODE_PATH="$(dirname "$(readlink -f "$0")")/.."
|
||||
else
|
||||
# else use the standard install location
|
||||
VSCODE_PATH="/usr/share/@@NAME@@"
|
||||
|
||||
Reference in New Issue
Block a user