Skip to content

Commit dd27c24

Browse files
euankvdemeester
authored andcommitted
pass: trim pass show output
As of 8446a40, pass show will include a newline when showing a password. This causes the pass helper here to reliably fail to initialize since a password doesn't round-trip. Before making this change, the pass test would fail if the installed password-store version was v1.7.1+, and after this change it passes again. Fixes #107 Signed-off-by: Euan Kemp <[email protected]>
1 parent 26deb29 commit dd27c24

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pass/pass_linux.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ func runPass(stdin string, args ...string) (string, error) {
5858
return "", fmt.Errorf("%s: %s", err, stderr.String())
5959
}
6060

61-
return stdout.String(), nil
61+
// trim newlines; pass v1.7.1+ includes a newline at the end of `show` output
62+
return strings.TrimRight(stdout.String(), "\n\r"), nil
6263
}
6364

6465
// Pass handles secrets using Linux secret-service as a store.

0 commit comments

Comments
 (0)