Skip to content

Commit 279ed07

Browse files
authored
updated to remove file error with broken file
1 parent 4b68b2b commit 279ed07

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/dotenv/cli.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ def run(ctx: click.Context, override: bool, commandline: List[str]) -> None:
130130
def example_file(ctx: click.Context):
131131
'''Generates a .example.env file without values.'''
132132
filedir = ctx.obj['FILE'].replace("\\", "/")
133+
if not os.path.isfile(file):
134+
raise click.BadParameter(
135+
'Path "%s" does not exist.' % (file),
136+
ctx=ctx
137+
)
133138
newFileList = []
134139
with open(filedir,'r') as file:
135140
for line in file:

0 commit comments

Comments
 (0)