[+] improve cli_bootstrap
This commit is contained in:
parent
54134ed0a8
commit
a103f06be8
@ -133,6 +133,25 @@ class CLI(_cli.CLI):
|
|||||||
|
|
||||||
options, args = parser.parse_known_args(argv[1:])
|
options, args = parser.parse_known_args(argv[1:])
|
||||||
|
|
||||||
|
default_project : Optional[str] = None
|
||||||
|
|
||||||
|
for k, v in self.projects.items():
|
||||||
|
if (
|
||||||
|
cli_bootstrap.paths_equal(
|
||||||
|
v.source_dir.resolve(),
|
||||||
|
# pathlib.Path(__file__).parent.resolve(),
|
||||||
|
pathlib.Path.cwd(),
|
||||||
|
)
|
||||||
|
):
|
||||||
|
default_project = k
|
||||||
|
|
||||||
|
if options.project is None:
|
||||||
|
if not default_project is None:
|
||||||
|
options.project = default_project
|
||||||
|
else:
|
||||||
|
logger.error(dict(msg='not provided project name'))
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
options.command = Command(options.command)
|
options.command = Command(options.command)
|
||||||
|
|
||||||
if options.command is Command.deploy_wheel:
|
if options.command is Command.deploy_wheel:
|
||||||
|
@ -333,6 +333,6 @@ def run(
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
run(
|
run(
|
||||||
d=pathlib.Path(__file__).parent / 'python' / 'pyproject.toml',
|
d=pathlib.Path(__file__).parent / 'pyproject.toml',
|
||||||
cli_path=pathlib.Path(__file__).parent / 'python' / 'cli.py',
|
cli_path=pathlib.Path(__file__).parent / 'cli.py',
|
||||||
)
|
)
|
Loading…
Reference in New Issue
Block a user