From c5cf9164a6bc94193b5b3cb01c0df49b642e5494 Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Mon, 24 Aug 2020 13:33:51 +0530 Subject: [PATCH 1/3] fix: supervisor command does not require sudo --- bench/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bench/cli.py b/bench/cli.py index 63369a1d..36eff160 100755 --- a/bench/cli.py +++ b/bench/cli.py @@ -72,7 +72,7 @@ def check_uid(): def cmd_requires_root(): - if len(sys.argv) > 2 and sys.argv[2] in ('production', 'sudoers', 'supervisor', 'lets-encrypt', 'fonts', + if len(sys.argv) > 2 and sys.argv[2] in ('production', 'sudoers', 'lets-encrypt', 'fonts', 'print', 'firewall', 'ssh-port', 'role', 'fail2ban', 'wildcard-ssl'): return True if len(sys.argv) >= 2 and sys.argv[1] in ('patch', 'renew-lets-encrypt', 'disable-production'): From fe2d927133ea56a0c2a93505236384b7d4189b44 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Mon, 24 Aug 2020 15:28:33 +0530 Subject: [PATCH 2/3] fix: Show correct src of bench source --- bench/cli.py | 1 + bench/commands/utils.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bench/cli.py b/bench/cli.py index 36eff160..de949aba 100755 --- a/bench/cli.py +++ b/bench/cli.py @@ -18,6 +18,7 @@ from bench.utils import PatchError, bench_cache_file, check_latest_version, drop from_command_line = False change_uid_msg = "You should not run this command as root" +src = os.path.dirname(__file__) def cli(): diff --git a/bench/commands/utils.py b/bench/commands/utils.py index 63ab9bb1..78899d19 100644 --- a/bench/commands/utils.py +++ b/bench/commands/utils.py @@ -164,8 +164,8 @@ def disable_production(): @click.command('src', help="Prints bench source folder path, which can be used as: cd `bench src`") def bench_src(): - import bench - print(os.path.dirname(bench.__path__[0])) + from bench.cli import src + print(os.path.dirname(src)) @click.command('find', help="Finds benches recursively from location") From 1841b5fa9ce9dc13fbd91c975336b41639ed094a Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Mon, 24 Aug 2020 17:03:19 +0530 Subject: [PATCH 3/3] chore: bump bench to v5.2.1 --- bench/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bench/__init__.py b/bench/__init__.py index acb504df..eec75ea4 100644 --- a/bench/__init__.py +++ b/bench/__init__.py @@ -1,4 +1,4 @@ -VERSION = "5.2.0" +VERSION = "5.2.1" PROJECT_NAME = "frappe-bench" FRAPPE_VERSION = None