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:
commit
d9521b4406
@ -30,11 +30,10 @@ 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"):
|
||||||
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)
|
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)
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user