mirror of
https://github.com/YunoHost/apps.git
synced 2024-09-03 20:06:07 +02:00
[enh] add_or_update.py accept app id instead of url
This commit is contained in:
parent
df7665a97b
commit
d04e36835b
1 changed files with 8 additions and 1 deletions
|
@ -18,7 +18,7 @@ if __name__ == '__main__':
|
|||
sys.exit(0)
|
||||
|
||||
if len(sys.argv[1:]) < 2:
|
||||
print("I need a list of github urls after the json file")
|
||||
print("I need a list of github urls or app names after the json file")
|
||||
sys.exit(0)
|
||||
|
||||
if not os.path.exists(sys.argv[1]):
|
||||
|
@ -27,6 +27,13 @@ if __name__ == '__main__':
|
|||
content = json.load(open(sys.argv[1], "r"))
|
||||
|
||||
for url in sys.argv[2:]:
|
||||
if not url.startswith("http"):
|
||||
if url in content:
|
||||
url = content[url]["url"]
|
||||
else:
|
||||
print "App name '%s' not in %s" % (url, sys.argv[1])
|
||||
sys.exit(1)
|
||||
|
||||
if url.endswith("/"):
|
||||
url = url[:-1]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue