From 24bb9a9a91b9ad3d814fb582041a7902057c975d Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 20 Apr 2017 00:30:25 +0200 Subject: Fix comment --- cmd/signify/main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/signify/main.go b/cmd/signify/main.go index 58706ee..137bd67 100644 --- a/cmd/signify/main.go +++ b/cmd/signify/main.go @@ -6,7 +6,6 @@ import ( "fmt" "io/ioutil" "log" - "path" "path/filepath" "dim13.org/signify" @@ -185,7 +184,7 @@ func Sign(msgFile, secFile string, embed bool) error { return err } sigfile := signify.File{ - Comment: fmt.Sprintf("verify with %s", path.Base(secFile)), // TODO replace .sec with .pub + Comment: fmt.Sprintf("verify with %s", ToPub(secFile)), // TODO replace .sec with .pub RawKey: sigRaw, } if embed { @@ -220,3 +219,8 @@ func NamingScheme(pubFile, secFile string) bool { secExt := filepath.Ext(secFile) return pubExt == ".pub" && secExt == ".sec" && pubFile[:len(pubExt)] == secFile[:len(secExt)] } + +func ToPub(secFile string) string { + ext := filepath.Ext(secFile) + return filepath.Base(secFile[:len(ext)] + "pub") +} -- cgit v1.2.3