2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-14 09:14:04 +00:00

Merge pull request #1075 from gavindsouza/bench-cli-fix

fix: Handle no args passed in CLI
This commit is contained in:
gavin 2020-09-24 16:47:38 +05:30 committed by GitHub
commit d9521b4406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -30,10 +30,9 @@ def cli():
logger = setup_logging() logger = setup_logging()
logger.info(command) logger.info(command)
if sys.argv[1] not in ("src", ): if len(sys.argv) > 1 and sys.argv[1] not in ("src", ):
check_uid() check_uid()
change_uid() change_uid()
change_dir() change_dir()
if is_dist_editable(bench.PROJECT_NAME) and len(sys.argv) > 1 and sys.argv[1] != "src" and not get_config(".").get("developer_mode"): if is_dist_editable(bench.PROJECT_NAME) and len(sys.argv) > 1 and sys.argv[1] != "src" and not get_config(".").get("developer_mode"):

View File

@ -9,6 +9,7 @@ import git
# imports - module imports # imports - module imports
import bench import bench
import bench.cli
import bench.utils import bench.utils
from bench.release import get_bumped_version from bench.release import get_bumped_version
from bench.tests.test_base import FRAPPE_BRANCH, TestBenchBase from bench.tests.test_base import FRAPPE_BRANCH, TestBenchBase
@ -27,6 +28,10 @@ class TestBenchInit(TestBenchBase):
self.assertEqual( get_bumped_version('11.0.5-beta.22', 'prerelease'), '11.0.5-beta.23' ) self.assertEqual( get_bumped_version('11.0.5-beta.22', 'prerelease'), '11.0.5-beta.23' )
def test_utils(self):
self.assertEqual(subprocess.call("bench"), 0)
def test_init(self, bench_name="test-bench", **kwargs): def test_init(self, bench_name="test-bench", **kwargs):
self.init_bench(bench_name, **kwargs) self.init_bench(bench_name, **kwargs)
self.assert_folders(bench_name) self.assert_folders(bench_name)