mirror of
https://github.com/YunoHost/apps.git
synced 2024-09-03 20:06:07 +02:00
[enh] sanitize url in add_or_update.py
This commit is contained in:
parent
309f8e5b08
commit
b7b81baae1
1 changed files with 6 additions and 0 deletions
|
@ -27,6 +27,12 @@ if __name__ == '__main__':
|
|||
content = json.load(open(sys.argv[1], "r"))
|
||||
|
||||
for url in sys.argv[2:]:
|
||||
if url.endswith("/"):
|
||||
url = url[:-1]
|
||||
|
||||
if url.endswith(".git"):
|
||||
url = url[:-len(".git")]
|
||||
|
||||
if not url.startswith("https://github.com"):
|
||||
sys.stderr.write("WARNING: url '%s' doesn't starts with https://github.com, skip it\n" % url)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue