add split and check at beginning

This commit is contained in:
Louis Abel 2022-10-17 09:25:49 -07:00
parent da3901d742
commit 3d50223fe3
Signed by untrusted user: label
GPG Key ID: B37E62D143879B36

View File

@ -183,8 +183,18 @@ class RepoSync:
# The repo name should be valid # The repo name should be valid
if self.repo is not None: if self.repo is not None:
if self.repo not in self.repos: bad_repo_list = []
self.log.error(Color.FAIL + 'Invalid repository: ' + self.repo) repo_list_if_commas = self.repo.split(',')
for repoitem in repo_list_if_commands:
if repoitem not in self.repos:
bad_repo_list.append(repoitem)
if len(bad_repo_list) > 0:
self.log.error(
Color.BOLD + Color.RED + 'These repos are not listed:' + Color.END
)
for badrepo in bad_repo_list:
self.log.error(badrepo)
raise SystemExit() raise SystemExit()
def run(self): def run(self):