refactor: extract Claude local path to constant for maintainability
Extract the hardcoded Claude CLI local installation path to a constant CLAUDE_LOCAL_PATH to improve maintainability and make it easier to update if the installation path changes in the future. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,9 @@ AI_CHOICES = {
|
|||||||
"gemini": "Gemini CLI"
|
"gemini": "Gemini CLI"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Claude CLI local installation path after migrate-installer
|
||||||
|
CLAUDE_LOCAL_PATH = Path.home() / ".claude" / "local" / "claude"
|
||||||
|
|
||||||
# ASCII Art Banner
|
# ASCII Art Banner
|
||||||
BANNER = """
|
BANNER = """
|
||||||
███████╗██████╗ ███████╗ ██████╗██╗███████╗██╗ ██╗
|
███████╗██████╗ ███████╗ ██████╗██╗███████╗██╗ ██╗
|
||||||
@@ -339,8 +342,7 @@ def check_tool(tool: str, install_hint: str) -> bool:
|
|||||||
# and creates an alias at ~/.claude/local/claude instead
|
# and creates an alias at ~/.claude/local/claude instead
|
||||||
# This path should be prioritized over other claude executables in PATH
|
# This path should be prioritized over other claude executables in PATH
|
||||||
if tool == "claude":
|
if tool == "claude":
|
||||||
claude_local_path = Path.home() / ".claude" / "local" / "claude"
|
if CLAUDE_LOCAL_PATH.exists() and CLAUDE_LOCAL_PATH.is_file():
|
||||||
if claude_local_path.exists() and claude_local_path.is_file():
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if shutil.which(tool):
|
if shutil.which(tool):
|
||||||
|
|||||||
Reference in New Issue
Block a user