#!/usr/bin/env bash12if [[ "$OSTYPE" == "darwin"* ]]; then3realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }4ROOT=$(dirname $(dirname $(realpath "$0")))5else6ROOT=$(dirname $(dirname $(readlink -f $0)))7fi89function code() {10pushd $ROOT1112# Get electron, compile, built-in extensions13if [[ -z "${VSCODE_SKIP_PRELAUNCH}" ]]; then14node build/lib/preLaunch.js15fi1617NODE=$(node build/lib/node.js)18if [ ! -e $NODE ];then19# Load remote node20npm run gulp node21fi2223popd2425NODE_ENV=development \26VSCODE_DEV=1 \27$NODE $ROOT/scripts/code-server.js "$@"28}2930code "$@"313233