···11#!/usr/bin/env bash
22# SPDX-License-Identifier: MPL-2.0
33-# Sets EDITOR and related variables to use VS Code instead of firing up nano (or worse vi),
44-# based on env var detection of VSCODE_* vars. Utilized by git-commit and similar git commands
55-# that fire up an editor.
33+# Sets EDITOR and related variables to use VS Code instead of firing up nano (or worse vi) on
44+# your VS Code terminals, based on env var detection of VSCODE_* vars. Utilized by git-commit
55+# and similar git commands that fire up an editor, among others.
6677# Handle verbose logging
88log() {
···19192020 # If it is, set the path to the correct location
2121 __VSCODE_STABLE_CLI_PATH="${__VSCODE_BASE_PATH}/bin/remote-cli/code"
2222+ __VSCODE_STABLE_DESKTOP_PATH="${__VSCODE_BASE_PATH}/bin/code"
2223 __VSCODE_INSIDERS_CLI_PATH="${__VSCODE_BASE_PATH}/bin/remote-cli/code-insiders"
2424+ __VSCODE_INSIDERS_DESKTOP_PATH="${__VSCODE_BASE_PATH}/bin/code-insiders"
23252426 # Check if the stable or insiders version exists
2527 if [[ -f "$__VSCODE_INSIDERS_CLI_PATH" ]]; then
2628 VSCODE_CLI_PATH="$__VSCODE_INSIDERS_CLI_PATH"
2729 elif [[ -f "$__VSCODE_STABLE_CLI_PATH" ]]; then
2830 VSCODE_CLI_PATH="$__VSCODE_STABLE_CLI_PATH"
3131+ elif [[ -f "$__VSCODE_INSIDERS_DESKTOP_PATH" ]]; then
3232+ VSCODE_CLI_PATH="$__VSCODE_INSIDERS_DESKTOP_PATH"
3333+ elif [[ -f "$__VSCODE_STABLE_DESKTOP_PATH" ]]; then
3434+ VSCODE_CLI_PATH="$__VSCODE_STABLE_DESKTOP_PATH"
2935 fi
30363137 log "Using VS Code CLI path: ${VSCODE_CLI_PATH}"
+1-1
pkgs/detect-vscode-for-git.nix
···2233stdenv.mkDerivation {
44 pname = "detect-vscode-for-git";
55- version = "0.1.0";
55+ version = "0.2.0";
6677 src = ../misc/bash/lib/detect-vscode-for-git;
88