More accurate error if input_file is not exists
This patch is intended to make build log is more
accurate if input_file is not exists, then check if
it is a zipfile.
Change-Id: I30da0141ea44fc3ce0947f868a86a15a054a4346
Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
diff --git a/tools/releasetools/img_from_target_files.py b/tools/releasetools/img_from_target_files.py
index 5409194..cbb51e1 100755
--- a/tools/releasetools/img_from_target_files.py
+++ b/tools/releasetools/img_from_target_files.py
@@ -187,6 +187,9 @@
Raises:
ValueError: On invalid input.
"""
+ if not os.path.exists(input_file):
+ raise ValueError('%s is not exist' % input_file)
+
if not zipfile.is_zipfile(input_file):
raise ValueError('%s is not a valid zipfile' % input_file)