aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorMax <max@mxzero.net>2023-10-13 15:59:44 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2023-11-06 15:42:59 -0500
commitd4eb9f85d07351e184ba16ff91c327425653d3e9 (patch)
tree7b2540b55f1f492b06468cd78afcdfd7f35d93b8 /contrib
parent535088c8096b028d3c0c3ceaf7b49aeec4258fa1 (diff)
downloadcalcurse-d4eb9f85d07351e184ba16ff91c327425653d3e9.tar.gz
calcurse-d4eb9f85d07351e184ba16ff91c327425653d3e9.zip
Remove new line character from result of password command
For example, using `pass caldav` as `PasswordCommand` returns the password for the account including a newline character at the end because the whole output is captured. This fix removes the new line character at the end of the line while keeping other whitespace character should the password contain any at the end. Signed-off-by: Max <max@mxzero.net> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/caldav/calcurse-caldav.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/caldav/calcurse-caldav.py b/contrib/caldav/calcurse-caldav.py
index f9488e6..8cccdf7 100755
--- a/contrib/caldav/calcurse-caldav.py
+++ b/contrib/caldav/calcurse-caldav.py
@@ -680,7 +680,8 @@ elif config.get('Auth', 'Password'):
password = config.get('Auth', 'Password')
elif config.get('Auth', 'PasswordCommand'):
tokenized_cmd = shlex.split(config.get('Auth', 'PasswordCommand'))
- password = subprocess.run(tokenized_cmd, capture_output=True).stdout.decode('UTF-8')
+ password = subprocess.run(
+ tokenized_cmd, capture_output=True).stdout.decode('UTF-8').rstrip('\n')
else:
password = None