From 90d23139474d0ee8dc9b80d9b1b96192fc912218 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Wed, 12 Feb 2020 14:55:30 +0530 Subject: [PATCH] chore: drop `bench shell` command --- bench/commands/__init__.py | 3 +-- bench/commands/utils.py | 13 ------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/bench/commands/__init__.py b/bench/commands/__init__.py index 7e514012..090013c2 100755 --- a/bench/commands/__init__.py +++ b/bench/commands/__init__.py @@ -40,7 +40,7 @@ bench_command.add_command(switch_to_develop) from bench.commands.utils import (start, restart, set_nginx_port, set_ssl_certificate, set_ssl_certificate_key, set_url_root, - set_mariadb_host, set_default_site, download_translations, shell, backup_site, backup_all_sites, release, renew_lets_encrypt, + set_mariadb_host, set_default_site, download_translations, backup_site, backup_all_sites, release, renew_lets_encrypt, disable_production, bench_src, prepare_beta_release, set_redis_cache_host, set_redis_queue_host, set_redis_socketio_host, find_benches, migrate_env) bench_command.add_command(start) bench_command.add_command(restart) @@ -54,7 +54,6 @@ bench_command.add_command(set_redis_queue_host) bench_command.add_command(set_redis_socketio_host) bench_command.add_command(set_default_site) bench_command.add_command(download_translations) -bench_command.add_command(shell) bench_command.add_command(backup_site) bench_command.add_command(backup_all_sites) bench_command.add_command(release) diff --git a/bench/commands/utils.py b/bench/commands/utils.py index 8a78fea0..38dc28bf 100644 --- a/bench/commands/utils.py +++ b/bench/commands/utils.py @@ -116,19 +116,6 @@ def renew_lets_encrypt(): from bench.config.lets_encrypt import renew_certs renew_certs() -@click.command() -def shell(bench_path='.'): - if not os.environ.get('SHELL'): - print("Cannot get shell") - sys.exit(1) - if not os.path.exists('sites'): - print("sites dir doesn't exist") - sys.exit(1) - env = copy.copy(os.environ) - env['PS1'] = '(' + os.path.basename(os.path.dirname(os.path.abspath(__file__))) + ')' + env.get('PS1', '') - env['PATH'] = os.path.dirname(os.path.abspath(os.path.join('env','bin')) + ':' + env['PATH']) - os.chdir('sites') - os.execve(env['SHELL'], [env['SHELL']], env) @click.command('backup', help="Backup single site") @click.argument('site')