2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-12 00:06:36 +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,11 +30,10 @@ def cli():
logger = setup_logging()
logger.info(command)
if sys.argv[1] not in ("src", ):
if len(sys.argv) > 1 and sys.argv[1] not in ("src", ):
check_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"):
log("bench is installed in editable mode!\n\nThis is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`\n", level=3)

View File

@ -9,6 +9,7 @@ import git
# imports - module imports
import bench
import bench.cli
import bench.utils
from bench.release import get_bumped_version
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' )
def test_utils(self):
self.assertEqual(subprocess.call("bench"), 0)
def test_init(self, bench_name="test-bench", **kwargs):
self.init_bench(bench_name, **kwargs)
self.assert_folders(bench_name)