File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -95,13 +95,14 @@ def main():
9595
9696 # copy the file to the new project specific location
9797 try :
98- utils .make_directory (opts .old_file_path , new_file_path , opts .replace )
98+ file_copied = utils .make_directory (opts .old_file_path , new_file_path , opts .replace )
9999 except Exception as e :
100100 msg = "could not copy file: {} ({})"
101101 logger .exception (msg .format (lab_id , str (date )))
102102 raise (e )
103-
104- logger .info ("{of} -> {nf}" .format (of = opts .old_file_path , nf = new_file_path ))
103+
104+ if file_copied :
105+ logger .info ("{of} -> {nf}" .format (of = opts .old_file_path , nf = new_file_path ))
105106
106107 return
107108
Original file line number Diff line number Diff line change @@ -159,10 +159,14 @@ def get_test_data_path(project):
159159def make_directory (old_path , new_path , replace ):
160160 if os .path .exists (new_path ):
161161 if replace == 'no' :
162- raise ValueError ('replace option was not specified and output file exists' , new_path )
162+ print ('replace option was set to no and output file exists' , new_path )
163+ return False
164+
163165 if replace == 'yes' :
164166 os .remove (new_path )
165167 copyfile (old_path , new_path )
168+ return True
166169 else :
167170 os .makedirs (os .path .dirname (new_path ), exist_ok = True )
168171 copyfile (old_path , new_path )
172+ return True
You can’t perform that action at this time.
0 commit comments