[sysadmin-bin] Strip quotes from token



commit d89be8aa9fb19c3d3869941a9953b27abf0a433b
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Fri Jul 17 14:32:26 2020 +0200

    Strip quotes from token

 gitlab/mirror2github | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gitlab/mirror2github b/gitlab/mirror2github
index fd0b211..54ed0b8 100755
--- a/gitlab/mirror2github
+++ b/gitlab/mirror2github
@@ -16,6 +16,8 @@ def get_token(token_env, token_filename):
             with open(token_path) as f:
                 tokenfile = f.readline()
             token = tokenfile.rstrip().split("=")[1]
+            if token[0] == token[-1] == "'":
+                token = token[1:-1]
         else:
             print(f"Could not find {token_env} token", file=sys.stderr)
             sys.exit(1)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]