mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
fix: avoid resolving symlinks in shim PMG binary path (#303)
* fix: avoid resolving symlinks in shim PMG binary path Shims hardcoded the resolved Cellar path (e.g. /opt/homebrew/Cellar/pmg/0.16.0/bin/pmg) instead of the stable Homebrew symlink. This broke all shims after `brew upgrade` since the old Cellar directory is removed. Fixes #302 * fix pip test pkg version
This commit is contained in:
@@ -26,8 +26,8 @@ func ProtectionTestCases() []ProtectionTestCase {
|
||||
},
|
||||
{
|
||||
PackageManager: "pip",
|
||||
Package: "safedep-test-pkg==0.1.4",
|
||||
InstallArgs: []string{"pip", "install", "--no-cache-dir", "safedep-test-pkg==0.1.4"},
|
||||
Package: "safedep-test-pkg==0.0.4",
|
||||
InstallArgs: []string{"pip", "install", "--no-cache-dir", "safedep-test-pkg==0.0.4"},
|
||||
NeedsVenv: true,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -136,12 +136,7 @@ func currentExecutable() (string, error) {
|
||||
return "", fmt.Errorf("failed to resolve pmg executable: %w", err)
|
||||
}
|
||||
|
||||
resolved, err := filepath.EvalSymlinks(exe)
|
||||
if err != nil {
|
||||
return filepath.Abs(exe)
|
||||
}
|
||||
|
||||
return resolved, nil
|
||||
return filepath.Abs(exe)
|
||||
}
|
||||
|
||||
func shellQuote(value string) string {
|
||||
|
||||
Reference in New Issue
Block a user