summon: 0.8.2 -> 0.9.6

This commit is contained in:
Aaron Jheng 2023-07-08 13:06:12 +00:00
parent 6559eb3572
commit 1d591b34d8
No known key found for this signature in database
GPG Key ID: F6A547A869D050A3
2 changed files with 4 additions and 47 deletions

View File

@ -1,24 +1,20 @@
{ buildGoModule, fetchFromGitHub, lib, patchResolver ? true }:
{ buildGoModule, fetchFromGitHub, lib }:
buildGoModule rec {
pname = "summon";
version = "0.8.2";
version = "0.9.6";
src = fetchFromGitHub {
owner = "cyberark";
repo = "summon";
rev = "v${version}";
sha256 = "1z4xnrncwvp3rfm97zvc0ivvw2fh1hrjhj3rplvidzxjfyasbvwv";
hash = "sha256-OOIq6U7HCxcYvBFZdewSpglg9lFzITsb6IPu/EID+Z0=";
};
vendorSha256 = "1597vrs4b7k6gkmkvf7xnd38rvjixmlcz0j7npmik9nbkm57l74m";
vendorHash = "sha256-qh3DJFxf1FqYgbULo4M+0nSOQ6uTlMTjAqNl7l+IPvk=";
subPackages = [ "cmd" ];
# Patches provider resolver to support resolving unqualified names
# from $PATH, e.g. `summon -p gopass` instead of `summon -p $(which gopass)`
patches = lib.optionals patchResolver [ ./resolve-paths.patch ];
postInstall = ''
mv $out/bin/cmd $out/bin/summon
'';

View File

@ -1,39 +0,0 @@
From dd34727ebfbd59738084eeb7c2a020e40a4d0abe Mon Sep 17 00:00:00 2001
From: Quentin <Quentin Inkling>
Date: Mon, 29 Jun 2020 17:35:04 +0300
Subject: [PATCH] Patch for
---
provider/provider.go | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/provider/provider.go b/provider/provider.go
index c1e28d9..f20fdaa 100644
--- a/provider/provider.go
+++ b/provider/provider.go
@@ -78,7 +78,22 @@ func expandPath(provider string) string {
if path.Base(provider) != provider {
return provider
}
+
+ var (
+ stdOut bytes.Buffer
+ stdErr bytes.Buffer
+ )
+ cmd := exec.Command("which", provider)
+ cmd.Stdout = &stdOut
+ cmd.Stderr = &stdErr
+ err := cmd.Run()
+
+ if err == nil {
+ return strings.TrimSpace(stdOut.String())
+ }
+
return path.Join(DefaultPath, provider)
+
}
func getDefaultPath() string {
--
2.27.0