mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] redo yolo logic in case file doesn't exist
This commit is contained in:
parent
911a4ec507
commit
d3f7809fb4
1 changed files with 11 additions and 4 deletions
|
@ -698,11 +698,18 @@ def _get_files_diff(orig_file, new_file, as_string=False, skip_header=True):
|
|||
header can also be removed if skip_header is True.
|
||||
|
||||
"""
|
||||
|
||||
if os.path.exists(orig_file):
|
||||
with open(orig_file, 'r') as orig_file:
|
||||
orig_file = orig_file.readlines()
|
||||
else:
|
||||
orig_file = []
|
||||
|
||||
if not os.path.exists(new_file):
|
||||
with open(new_file, 'r') as new_file:
|
||||
new_file.readlines()
|
||||
else:
|
||||
new_file = []
|
||||
|
||||
# Compare files and format output
|
||||
diff = unified_diff(orig_file, new_file)
|
||||
|
|
Loading…
Add table
Reference in a new issue