diff --git a/README.md b/README.md index cb4dc079aac83096af67bcd85d7a18be11c73b73..54f9fd738f00deb169977457b22e6744cc3f2320 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Le moment est venu de créer les dépôts git pour chaque groupe/étudiant suiva ## Utilisation de pwm -Ce programme est écrit en python et testé avec la version 3.9.0, avec les dépendances suivantes (voir `requirements.txt`) : +Ce programme est écrit en python et testé avec les versions 3.6, 3.7, 3.8 et 3.9, avec les dépendances suivantes (voir `requirements.txt`) : ``` requests diff --git a/pwm b/pwm index 51b0a323ec8feff0893c37bb9779ed430f5003a4..9f85c32e15678fb613b0bdcb12b7acbcbbe4a536 100755 --- a/pwm +++ b/pwm @@ -281,7 +281,7 @@ if __name__ == '__main__': 'clone', help='Clone the repositories locally') group_clone = parser_clone.add_mutually_exclusive_group() group_clone.add_argument("-g", "--group", action="store_true", - help="Clone repositories from a group (with group_id) or forks of a project (with project_id) (default behavior).") + help="Clone repositories from a group (with group_id) (default behavior).") group_clone.add_argument("-f", "--forks", action="store_true", help="Clone forks of a project (with project_id).") parser_clone.add_argument( @@ -295,13 +295,16 @@ if __name__ == '__main__': args = parser.parse_args() if not args.token: - if os.path.isfile(path := os.environ.get('HOME') + '/.gitedu_token'): - with open(path) as file: - args.token = file.read().strip() + home = os.environ.get('HOME') + if home: + token_file = home + '/.gitedu_token' + if os.path.isfile(token_file): + with open(token_file) as file: + args.token = file.read().strip() elif os.environ.get('GITEDU_TOKEN'): args.token = os.environ.get('GITEDU_TOKEN') else: - print('Error: you must given a token') + print('Error: you must give a valid api token. Create a token here: https://gitedu.hesge.ch/profile/personal_access_tokens') exit(1) args.func(args)