-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild
executable file
·43 lines (34 loc) · 1.7 KB
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
set -e
# Remove any previously compiled versions.
rm *.vsix || true
echo "================================================================================"
echo "Packaging extension..."
echo "================================================================================"
yes | vsce package
# Install the compiled extension.
echo ""
echo "================================================================================"
echo "Installing extension..."
echo "================================================================================"
# Uninstalling the old version seems to be necessary to force Code to pick up the new version reliably.
code --uninstall-extension phillco.cursorless-sidecar || true
code --install-extension *.vsix --force
if [[ -x "$(command -v code-insiders)" ]]; then
# Also install into insiders, if it exists.
code-insiders --uninstall-extension phillco.cursorless-sidecar || true
code-insiders --install-extension *.vsix --force
fi
echo ""
echo "================================================================================"
echo "Reloading VS Code..."
echo "================================================================================"
# Use the command socket to tell VS Code to reload in the background, if socat is installed.
if [[ $(type -P "socat") ]] && [[ -e ~/.cursorless/vscode-socket ]]; then
echo "Reloading VS Code using the command socket..."
echo '{ "command": "command", "commandId": "workbench.action.reloadWindow" }' | socat - ~/.cursorless/vscode-socket
else
echo "Not automatically reloading VS Code because \`socat\` is not installed"
echo "Reload the VS Code window manually (\"window reload\") to get the new version"
fi
echo "Done"