2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-09 08:30:39 +00:00

Merge pull request #661 from codingCoffee/multi_fixes

Multi fixes
This commit is contained in:
Ameya Shenoy 2018-07-03 14:31:32 +05:30 committed by GitHub
commit af315f174e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 7 deletions

View File

@ -144,6 +144,7 @@ For production:
--- ---
## Bench Manger (GUI for Bench) ## Bench Manger (GUI for Bench)
Bench Manager is a graphical user interface to emulate the functionalities of Frappé Bench. Like the command line utility it helps you install apps, manage multiple sites, update apps and much more. Bench Manager is a graphical user interface to emulate the functionalities of Frappé Bench. Like the command line utility it helps you install apps, manage multiple sites, update apps and much more.
@ -155,9 +156,8 @@ $ bench setup manager
``` ```
What all it does: What all it does:
1. Create new site bench-manager.local 1. Create new site bench-manager.local
2. Gets the bench_manager app from https://github.com/frappe/bench_manager if it doesn't exist already 2. Gets the `bench_manager` app from https://github.com/frappe/bench_manager if it doesn't exist already
3. Installs the bench_manager app on the site bench-manager.local 3. Installs the bench_manager app on the site bench-manager.local
## Docker Install - For Developers (beta) ## Docker Install - For Developers (beta)

View File

@ -234,14 +234,19 @@ Here are your choices:
wait for them to be merged in the core.'''.format(app)) wait for them to be merged in the core.'''.format(app))
sys.exit(1) sys.exit(1)
for app in get_apps(bench_path=bench_path):
excluded_apps = get_excluded_apps() excluded_apps = get_excluded_apps()
for app in get_apps(bench_path=bench_path):
if app in excluded_apps: if app in excluded_apps:
print("Skipping pull for app {}".format(app)) print("Skipping pull for app {}".format(app))
continue continue
app_dir = get_repo_dir(app, bench_path=bench_path) app_dir = get_repo_dir(app, bench_path=bench_path)
if os.path.exists(os.path.join(app_dir, '.git')): if os.path.exists(os.path.join(app_dir, '.git')):
remote = get_remote(app) remote = get_remote(app)
if not remote:
# remote is False, i.e. remote doesn't exist, add the app to excluded_apps.txt
add_to_excluded_apps_txt(app, bench_path=bench_path)
print("Skipping pull for app {}, since remote doesn't exist, and adding it to excluded apps".format(app))
continue
logger.info('pulling {0}'.format(app)) logger.info('pulling {0}'.format(app))
if reset: if reset:
exec_cmd("git fetch --all", cwd=app_dir) exec_cmd("git fetch --all", cwd=app_dir)
@ -288,12 +293,13 @@ def get_remote(app, bench_path='.'):
stderr=subprocess.STDOUT) stderr=subprocess.STDOUT)
contents = contents.decode('utf-8') contents = contents.decode('utf-8')
if re.findall('upstream[\s]+', contents): if re.findall('upstream[\s]+', contents):
remote = 'upstream' return 'upstream'
elif not contents:
# if contents is an empty string => remote doesn't exist
return False
else: else:
# get the first remote # get the first remote
remote = contents.splitlines()[0].split()[0] return contents.splitlines()[0].split()[0]
return remote
def use_rq(bench_path): def use_rq(bench_path):
bench_path = os.path.abspath(bench_path) bench_path = os.path.abspath(bench_path)