Skip to content

Commit

Permalink
feat(cli): add support for execution via 'python -m' (#395)
Browse files Browse the repository at this point in the history
Co-authored-by: Saurabh Kumar <theskumar@noreply.users.github.com>
  • Loading branch information
theskumar and Saurabh Kumar committed Apr 17, 2022
1 parent 8080d1d commit 769a040
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -37,7 +37,7 @@ def read_files(files):
},
entry_points={
"console_scripts": [
"dotenv=dotenv.cli:cli",
"dotenv=dotenv.__main__:cli",
],
},
license='BSD-3-Clause',
Expand Down
6 changes: 6 additions & 0 deletions src/dotenv/__main__.py
@@ -0,0 +1,6 @@
"""Entry point for cli, enables execution with `python -m dotenv`"""

from .cli import cli

if __name__ == "__main__":
cli()
4 changes: 0 additions & 4 deletions src/dotenv/cli.py
Expand Up @@ -158,7 +158,3 @@ def run_command(command: List[str], env: Dict[str, str]) -> int:
_, _ = p.communicate()

return p.returncode


if __name__ == "__main__":
cli()

0 comments on commit 769a040

Please sign in to comment.