From 168ea9a0b171f957a1604a0631ec55af1be525d2 Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Tue, 15 May 2018 13:42:19 +0530 Subject: [PATCH 1/2] added installation of bench-manager to readme --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 9cfff9e4..f10cbe90 100755 --- a/README.md +++ b/README.md @@ -144,6 +144,18 @@ For production: --- +## Bench Manager +Bench Manager is a graphical user interface to emulate the functionalities of Frappe Bench. Like the command line utility it helps you install apps, manage multiple sites, update apps and much more, in the form of a frappe website. + +``` +$ bench setup manager +``` + +What all it does: +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 +3. Installs the bench_manager app on the site bench-manager.local + ## Docker Install - For Developers (beta) 1. For developer setup, you can also use the official [Frappé Docker](https://github.com/frappe/frappe_docker/). From 2591da06225a1d1e8a5c6b00f75e116a6f428f52 Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Tue, 15 May 2018 16:18:02 +0530 Subject: [PATCH 2/2] [fix] update fails if no remote found - The bench update used to fail if there was no remote found for the app. Fixed by adding check if remote exists. If it doesn't the app is added to excluded_apps.txt and not considered for an update - [minor] optimized get_excluded_apps list by calling it only once, as opposed to getting it for every app --- bench/app.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/bench/app.py b/bench/app.py index 663b6a34..28e35342 100755 --- a/bench/app.py +++ b/bench/app.py @@ -222,14 +222,19 @@ Here are your choices: wait for them to be merged in the core.'''.format(app)) sys.exit(1) + excluded_apps = get_excluded_apps() for app in get_apps(bench_path=bench_path): - excluded_apps = get_excluded_apps() if app in excluded_apps: print("Skipping pull for app {}".format(app)) continue app_dir = get_repo_dir(app, bench_path=bench_path) if os.path.exists(os.path.join(app_dir, '.git')): 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)) if reset: exec_cmd("git fetch --all", cwd=app_dir) @@ -276,12 +281,13 @@ def get_remote(app, bench_path='.'): stderr=subprocess.STDOUT) contents = contents.decode('utf-8') 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: # get the first remote - remote = contents.splitlines()[0].split()[0] - - return remote + return contents.splitlines()[0].split()[0] def use_rq(bench_path): bench_path = os.path.abspath(bench_path)