Skip to content

Commit 6ed0dec

Browse files
committed
BATS: set Linux credhelper
If `pass` is not available, assume we'll be using secret service as the credential helper instead. Signed-off-by: Mark Yen <mark.yen@suse.com>
1 parent d016104 commit 6ed0dec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bats/tests/helpers/commands.bash

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ fi
1717
if is_macos; then
1818
CRED_HELPER="$PATH_RESOURCES/$PLATFORM/bin/docker-credential-osxkeychain"
1919
elif is_linux; then
20-
CRED_HELPER="$PATH_RESOURCES/$PLATFORM/bin/docker-credential-pass"
20+
if command -v pass; then
21+
CRED_HELPER="$PATH_RESOURCES/$PLATFORM/bin/docker-credential-pass"
22+
else
23+
CRED_HELPER="$PATH_RESOURCES/$PLATFORM/bin/docker-credential-secretservice"
24+
fi
2125
elif is_windows; then
2226
# Our docker-cli for WSL defaults to "wincred.exe" as well
2327
CRED_HELPER="$PATH_RESOURCES/win32/bin/docker-credential-wincred.exe"

0 commit comments

Comments
 (0)