Guest User

Untitled

a guest
Apr 23rd, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. #!/nix/store/zqh3l3lyw32q1ayb15bnvg9f24j5v2p0-bash-4.4-p12/bin/bash
  2. #
  3. # Copyright (c) Microsoft Corporation. All rights reserved.
  4. # Licensed under the MIT License. See License.txt in the project root for license information.
  5.  
  6. # If root, ensure that --user-data-dir or --file-write is specified
  7. if [ "$(id -u)" = "0" ]; then
  8. for i in $@
  9. do
  10. if [[ $i == --user-data-dir || $i == --user-data-dir=* || $i == --file-write ]]; then
  11. CAN_LAUNCH_AS_ROOT=1
  12. fi
  13. done
  14. if [ -z $CAN_LAUNCH_AS_ROOT ]; then
  15. 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
  16. exit 1
  17. fi
  18. fi
  19.  
  20. if [ ! -L $0 ]; then
  21. # if path is not a symlink, find relatively
  22. VSCODE_PATH="$(dirname $0)/.."
  23. else
  24. if which readlink >/dev/null; then
  25. # if readlink exists, follow the symlink and find relatively
  26. VSCODE_PATH="$(dirname $(readlink -f $0))/.."
  27. else
  28. # else use the standard install location
  29. VSCODE_PATH="/usr/share/code"
  30. fi
  31. fi
  32.  
  33. ELECTRON="$VSCODE_PATH/code"
  34. CLI="$VSCODE_PATH/resources/app/out/cli.js"
  35. ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "--skip-getting-started" "$@"
  36. exit $?
Add Comment
Please, Sign In to add comment