您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

38 行
1.0 KiB

  1. # imports - standard imports
  2. import os
  3. import subprocess
  4. # imports - module imports
  5. from bench.bench import Bench
  6. from bench.app import get_repo_dir
  7. from bench.utils import set_git_remote_url
  8. from bench.utils.app import get_remote
  9. # imports - third party imports
  10. import click
  11. @click.command('remote-set-url', help="Set app remote url")
  12. @click.argument('git-url')
  13. def remote_set_url(git_url):
  14. set_git_remote_url(git_url)
  15. @click.command('remote-reset-url', help="Reset app remote url to xhiveframework official")
  16. @click.argument('app')
  17. def remote_reset_url(app):
  18. git_url = f"https://lab.membtech.com/xhiveframework/{app}.git"
  19. set_git_remote_url(git_url)
  20. @click.command('remote-urls', help="Show apps remote url")
  21. def remote_urls():
  22. for app in Bench(".").apps:
  23. repo_dir = get_repo_dir(app)
  24. if os.path.exists(os.path.join(repo_dir, '.git')):
  25. remote = get_remote(app)
  26. remote_url = subprocess.check_output(['git', 'config', '--get', f'remote.{remote}.url'], cwd=repo_dir).strip()
  27. print(f"{app}\t{remote_url}")