Skip to content

Commit fab71ac

Browse files
committed
Do not resolve symlinks.
See: #188 14c7fcc
1 parent 14c7fcc commit fab71ac

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

meta_package_manager/base.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,16 @@ def cli_path(self):
149149
logger.debug(f"{self.cli_name} CLI not found.")
150150
return
151151

152-
# Normalize CLI path and check it is a file.
153-
cli_path = Path(cli_path).resolve(strict=True)
154-
logger.debug(f"CLI found at {cli_path}")
155-
156-
if not cli_path.is_file():
152+
# Check if path exist and is a file.
153+
# Do not resolve symlink here. Some manager like Homebrew on Linux rely on some
154+
# sort of synlink trickery to set environment variables.
155+
cli_path = Path(cli_path)
156+
if not cli_path.exists():
157+
raise FileNotFoundError(f"{cli_path}")
158+
elif not cli_path.is_file():
157159
logger.warning(f"{cli_path} is not a file.")
158-
return
160+
else:
161+
logger.debug(f"CLI found at {cli_path}")
159162

160163
return cli_path
161164

meta_package_manager/managers/homebrew.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ class Homebrew(PackageManager):
4343
# 2.7.0 is the first release to enforce the use of --cask option.
4444
requirement = "2.7.0"
4545

46-
# Help mpm a little bit in its search for the `brew` binary on Linux.
47-
cli_search_path = ["~/.linuxbrew"]
48-
4946
# Declare this manager as virtual, i.e. not tied to a real CLI.
5047
cli_name = None
5148

0 commit comments

Comments
 (0)