From 0dfe5c342a7b44ace450c5c7c8d905a5ccdb9522 Mon Sep 17 00:00:00 2001 From: Martin O'Reilly Date: Wed, 5 Apr 2017 16:36:52 +0100 Subject: [PATCH] Add OS check for OSX specific keychain args Keychain arguments are only supported on Mac OSX. Added check for operating system so we give a "Keychain arguments are only supported on Mac OSX" error message rather than a "No password item matching the provided name and account could be found in the osx keychain" error message --- bin/github-backup | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/github-backup b/bin/github-backup index c3c1208..5a2a635 100755 --- a/bin/github-backup +++ b/bin/github-backup @@ -16,6 +16,7 @@ import select import subprocess import sys import time +import platform try: # python 3 from urllib.parse import urlparse @@ -267,6 +268,8 @@ def get_auth(args, encode=True): if not args.osx_keychain_item_account: log_error('You must specify both name and account fields for osx keychain password items') else: + if platform.system() != 'Darwin': + log_error("Keychain arguments are only supported on Mac OSX") try: with open(os.devnull,'w') as devnull: token = (subprocess.check_output([