Fix: No prompt for the password, then an error #1

This commit is contained in:
muxueqz 2020-04-09 17:54:41 +08:00
parent 9e91943a07
commit dac69aa386

View file

@ -52,13 +52,29 @@ if operation == "get":
) )
find_path = _find_path.decode('utf8').replace(password_store_path, '').strip('\n') find_path = _find_path.decode('utf8').replace(password_store_path, '').strip('\n')
client = subprocess.check_output( try:
[ client = subprocess.check_output(
'pass', [
'show', 'pass',
find_path, 'show',
] find_path,
) ]
)
except subprocess.CalledProcessError:
subprocess.check_output(
[
'xterm', '-e',
'pass show "%s"' % find_path,
]
)
client = subprocess.check_output(
[
'pass',
'show',
find_path,
]
)
extractor = client.decode('utf8').split('\n') extractor = client.decode('utf8').split('\n')
repo_logins = {} repo_logins = {}
repo_logins['login'] = ': '.join(extractor[1].split(': ')[1:]) repo_logins['login'] = ': '.join(extractor[1].split(': ')[1:])