Files
azuredatastudio/scripts/sql.sh
Kevin Cunnane 5c63f7bdb5 Support installing SQL Server Notebook extension (#6432)
This adds SQL Server Notebook as a built-in extension
by pulling it from blob storage.
It also adds support in mssql extension for reading the contribution points from other extensions.
This will contribute troubleshooting and other books as widgets.
In this commit:
- Bundle the extension in the build
- Bundle in sql.sh / sql.bat so it appears in local testing
- Avoid installing in Stable. Should only appear in Dev/Insiders builds
- Extensions with `notebook.books` contribution point will be discovered & their books available in MSSQL

Coming later:
- Integrate this with Maddy's work to show a Notebooks widget in the SQL Server big data cluster UI
- When clause isn't supported yet for filtering. Will be done as we refactor towards more books for different server types
2019-07-19 16:11:57 -07:00

48 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
if [[ "$OSTYPE" == "darwin"* ]]; then
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
ROOT=$(dirname $(dirname $(realpath "$0")))
else
ROOT=$(dirname $(dirname $(readlink -f $0)))
fi
function code() {
cd $ROOT
if [[ "$OSTYPE" == "darwin"* ]]; then
NAME=`node -p "require('./product.json').nameLong"`
CODE="./.build/electron/$NAME.app/Contents/MacOS/Electron"
else
NAME=`node -p "require('./product.json').applicationName"`
CODE=".build/electron/$NAME"
fi
INTENDED_VERSION="v`node -p "require('./package.json').electronVersion"`"
INSTALLED_VERSION=`cat .build/electron/version 2> /dev/null`
# Node modules
test -d node_modules || ./scripts/npm.sh install
# Get electron
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
# Sync built-in extensions
node build/lib/builtInExtensions.js
# Build
test -d out || ./node_modules/.bin/gulp compile
# Configuration
export NODE_ENV=development
export VSCODE_DEV=1
export VSCODE_CLI=1
export ELECTRON_ENABLE_LOGGING=1
export ELECTRON_ENABLE_STACK_DUMPING=1
# Launch Code
exec "$CODE" . "$@"
}
code "$@"