Skip to content

Commit

Permalink
refactor: tidy codes
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
  • Loading branch information
jfcherng committed Aug 17, 2024
1 parent 7510f4a commit 099d1c7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugin/commands/open_git_repo_on_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import threading
from functools import lru_cache, wraps
from pathlib import Path
from typing import Any, Callable, Final, TypeVar, cast
from typing import Any, Callable, TypeVar, cast

import sublime
import sublime_plugin
Expand Down Expand Up @@ -180,8 +180,10 @@ def find_git_bin() -> str | None:
if os.name == "nt":
if sublime_merge_path:
candidates.append(Path(sublime_merge_path) / "Git/cmd/git.exe")
candidates.append(R"C:\Program Files\Sublime Merge\Git\cmd\git.exe")
candidates.append(Path(sublime.executable_path()) / "../../Sublime Merge/Git/cmd/git.exe")
candidates.extend((
R"C:\Program Files\Sublime Merge\Git\cmd\git.exe", # default installation
Path(sublime.executable_path()) / "../../Sublime Merge/Git/cmd/git.exe", # neighbor installation
))

return first_true(map(shutil.which, map(str, candidates)))

Expand Down

0 comments on commit 099d1c7

Please sign in to comment.