2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-12 00:06:36 +00:00

refactor: consistent help action in click, formatting and sorted imports

This commit is contained in:
Gavin D'souza 2020-02-18 11:56:46 +05:30
parent 53e2272a66
commit 9621686597

View File

@ -1,28 +1,31 @@
import click # imports - standard imports
import os, subprocess, re import os
import re
import subprocess
# imports - module imports
from bench.app import get_repo_dir, get_apps, get_remote from bench.app import get_repo_dir, get_apps, get_remote
from bench.utils import set_git_remote_url from bench.utils import set_git_remote_url
# imports - third party imports
import click
@click.command('remote-set-url')
@click.command('remote-set-url', help="Set app remote url")
@click.argument('git-url') @click.argument('git-url')
def remote_set_url(git_url): def remote_set_url(git_url):
"Set app remote url"
set_git_remote_url(git_url) set_git_remote_url(git_url)
@click.command('remote-reset-url') @click.command('remote-reset-url', help="Reset app remote url to frappe official")
@click.argument('app') @click.argument('app')
def remote_reset_url(app): def remote_reset_url(app):
"Reset app remote url to frappe official"
git_url = "https://github.com/frappe/{}.git".format(app) git_url = "https://github.com/frappe/{}.git".format(app)
set_git_remote_url(git_url) set_git_remote_url(git_url)
@click.command('remote-urls') @click.command('remote-urls', help="Show apps remote url")
def remote_urls(): def remote_urls():
"Show apps remote url"
for app in get_apps(): for app in get_apps():
repo_dir = get_repo_dir(app) repo_dir = get_repo_dir(app)