mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 01:25:38 -05:00
SQL Operations Studio Public Preview 1 (0.23) release source code
This commit is contained in:
36
resources/linux/bin/code.sh
Normal file
36
resources/linux/bin/code.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
|
||||
# If root, ensure that --user-data-dir is specified
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
for i in $@
|
||||
do
|
||||
if [[ $i == --user-data-dir=* ]]; then
|
||||
DATA_DIR_SET=1
|
||||
fi
|
||||
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
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -L $0 ]; then
|
||||
# if path is not a symlink, find relatively
|
||||
VSCODE_PATH="$(dirname $0)/.."
|
||||
else
|
||||
if which readlink >/dev/null; then
|
||||
# if readlink exists, follow the symlink and find relatively
|
||||
VSCODE_PATH="$(dirname $(readlink -f $0))/.."
|
||||
else
|
||||
# else use the standard install location
|
||||
VSCODE_PATH="/usr/share/@@NAME@@"
|
||||
fi
|
||||
fi
|
||||
|
||||
ELECTRON="$VSCODE_PATH/@@NAME@@"
|
||||
CLI="$VSCODE_PATH/resources/app/out/cli.js"
|
||||
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
|
||||
exit $?
|
||||
Reference in New Issue
Block a user