Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions packages/cursorless-vscode/scripts/install-from-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ if ! command -v gh &>/dev/null; then
exit 1
fi

# Ensure VSCode 'code' command is installed
if ! command -v code &>/dev/null; then
echo "VSCode 'code' command not found; see https://code.visualstudio.com/docs/editor/command-line#_launching-from-command-line"
# Use CURSORLESS_VSCODE_COMMAND if set, otherwise default to 'code'
vscode_command="${CURSORLESS_VSCODE_COMMAND:-code}"

# Ensure VSCode command is installed
if ! command -v "$vscode_command" &>/dev/null; then
echo "VSCode command '$vscode_command' not found"
echo "Install VS Code or set CURSORLESS_VSCODE_COMMAND to your VS Code binary (e.g., 'codium', 'cursor')"
echo "See: https://code.visualstudio.com/docs/editor/command-line"
exit 1
fi

Expand Down Expand Up @@ -47,10 +52,10 @@ trap finish EXIT
gh run download "$check_number" --repo "$repo" --name vsix --dir "$tmpdir"

# 4. Uninstall production cursorless
code --uninstall-extension pokey.cursorless || echo "Cursorless not currently installed"
"$vscode_command" --uninstall-extension pokey.cursorless || echo "Cursorless not currently installed"

# 5. Install downloaded extension
code --install-extension "$tmpdir/cursorless-development.vsix" --force
"$vscode_command" --install-extension "$tmpdir/cursorless-development.vsix" --force

echo -e "\e[1;32mPlease restart VSCode\e[0m"
echo "To uninstall and revert to production Cursorless, run the adjacent uninstall-local.sh"
16 changes: 14 additions & 2 deletions packages/cursorless-vscode/scripts/install-local.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail

# Use CURSORLESS_VSCODE_COMMAND if set, otherwise default to 'code'
vscode_command="${CURSORLESS_VSCODE_COMMAND:-code}"

# Ensure VSCode command is installed
if ! command -v "$vscode_command" &>/dev/null; then
echo "VSCode command '$vscode_command' not found"
echo "Install VS Code or set CURSORLESS_VSCODE_COMMAND to your VS Code binary (e.g., 'codium', 'cursor')"
echo "See: https://code.visualstudio.com/docs/editor/command-line"
exit 1
fi

# Bundles and installs a local version of Cursorless, uninstalling production
# Cursorless first and using a special extension id to break update chain

Expand All @@ -14,10 +26,10 @@ cd dist
vsce package -o ../bundle.vsix

# 3. Uninstall production cursorless
code --uninstall-extension pokey.cursorless || echo "Cursorless not currently installed"
"$vscode_command" --uninstall-extension pokey.cursorless || echo "Cursorless not currently installed"

# 4. Install local Cursorless
code --install-extension ../bundle.vsix --force
"$vscode_command" --install-extension ../bundle.vsix --force

echo -e "\e[1;32mPlease restart VSCode\e[0m"
echo "To uninstall and revert to production Cursorless, run the adjacent uninstall-local.sh"
15 changes: 13 additions & 2 deletions packages/cursorless-vscode/scripts/uninstall-local.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
#!/usr/bin/env bash
set -euo pipefail

# Use CURSORLESS_VSCODE_COMMAND if set, otherwise default to 'code'
vscode_command="${CURSORLESS_VSCODE_COMMAND:-code}"

# Ensure VSCode command is installed
if ! command -v "$vscode_command" &>/dev/null; then
echo "VSCode command '$vscode_command' not found"
echo "Install VS Code or set CURSORLESS_VSCODE_COMMAND to your VS Code binary (e.g., 'codium', 'cursor')"
echo "See: https://code.visualstudio.com/docs/editor/command-line"
exit 1
fi

# Switch back to production Cursorless extension locally after having run
# ./install-local.sh

# 1. Uninstall local cursorless
code --uninstall-extension pokey.cursorless-development || echo "Cursorless development version not currently installed"
"$vscode_command" --uninstall-extension pokey.cursorless-development || echo "Cursorless development version not currently installed"

# 2. Install production Cursorless
code --install-extension pokey.cursorless
"$vscode_command" --install-extension pokey.cursorless

echo -e "\e[1;32mPlease restart VSCode\e[0m"
Loading