NixOS + home-manager configs, mirrored from GitLab SaaS. gitlab.com/andreijiroh-dev/nixops-config
nix-flake nixos home-manager nixpkgs nix-flakes
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(detect-vscode-for-git): improve detection by fixing hard-coded HOME prefix

Just rely on the $HOME variable, alongside some debugging tooling at shell level.

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.dev>

+12 -3
+12 -3
misc/bash/lib/detect-vscode-for-git
··· 3 3 # Sets EDITOR and related variables to use VS Code instead of firing up nano (or worse vi), 4 4 # based on env var detection of VSCODE_* vars. 5 5 6 - if [[ -n $VSCODE_IPC_HOOK_CLI && -n $VSCODE_GIT_ASKPASS_NODE ]]; then 6 + # Handle verbose logging 7 + if [[ -n $DEBUG ]]; then 8 + set -x 9 + fi 10 + 11 + if [[ "$VSCODE_GIT_IPC_HANDLE" != "" && "$VSCODE_GIT_ASKPASS_NODE" != "" && "$TERM_PROGRAM" == "vscode" ]]; then 7 12 __VSCODE_BASE_PATH="$(dirname "${VSCODE_GIT_ASKPASS_NODE}")" 8 13 9 14 # Check if the path is in ~/.vscode/cli/servers (for Remote Tunnels), ~/.vscode-server/cli 10 15 # (for Remote SSH) or not 11 - if [[ $__VSCODE_BASE_PATH =~ ^/home/[^/]+/.vscode/cli/servers ]] || [[ $__VSCODE_BASE_PATH =~ ^/home/[^/]+/.vscode-server/cli ]]; then 16 + if [[ $__VSCODE_BASE_PATH =~ ^"$HOME"/.vscode/cli/servers ]] || [[ $__VSCODE_BASE_PATH =~ ^"$HOME"/.vscode-server/cli ]]; then 12 17 # If it is, set the path to the correct location 13 18 VSCODE_CLI_PATH="${__VSCODE_BASE_PATH}/bin/remote-cli/code" 14 19 else 15 - # otherwise just use plain cli 20 + # otherwise just use plain cli/desktop app CLI 16 21 VSCODE_CLI_PATH="$(command -v code)" 17 22 fi 18 23 19 24 export GIT_EDITOR="${VSCODE_CLI_PATH} --wait" EDITOR="${VSCODE_CLI_PATH} --wait" VISUAL="${VSCODE_CLI_PATH} --wait" VSCODE_CLI_PATH 20 25 fi 26 + 27 + if [[ -n $DEBUG ]]; then 28 + set +x 29 + fi