[ADD] add requirements file existence check to avoid file R/W error

This commit is contained in:
Zhongxian Jia 2018-03-13 16:39:21 +08:00
parent 24a04eee41
commit 5633827177

View File

@ -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)