mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-06 03:25:21 +00:00
[ADD] add requirements file existence check to avoid file R/W error
This commit is contained in:
parent
24a04eee41
commit
5633827177
@ -435,8 +435,12 @@ def init(args):
|
||||
os.path.join(input_path, "requirements.txt"))
|
||||
|
||||
if args["--diff"]:
|
||||
diff(args["--diff"], imports)
|
||||
return
|
||||
if os.path.exists(args["--diff"]):
|
||||
diff(args["--diff"], imports)
|
||||
return
|
||||
else:
|
||||
logging.info("The file [ %s ] not exist" % args["--diff"])
|
||||
return
|
||||
|
||||
if args["--clean"]:
|
||||
clean(args["--clean"], imports)
|
||||
|
Loading…
x
Reference in New Issue
Block a user