@@ -833,19 +833,18 @@ def main():
833
833
# Verify the project directory exists.
834
834
if not os .path .exists (args .project_directory ):
835
835
print ("The project folder specified does not exist." )
836
- return
837
-
838
- # Make sure output directory exists.
839
- if not os .path .exists (args .output_directory ):
840
- print ("The output folder already exists." )
841
- return
836
+ sys .exit (1 )
842
837
843
838
# If no output directory, provide a default one.
844
839
if args .output_directory is "" :
845
- args .project_directory = args .project_directory [0 :-
846
- 1 ] if args .project_directory .endswith ("/" ) else args .project_directory
840
+ args .project_directory .rstrip ("/" )
847
841
args .output_directory = args .project_directory + "_amd"
848
842
843
+ # Make sure output directory does not exist.
844
+ if not os .path .exists (args .output_directory ):
845
+ print ("The output folder already exists." )
846
+ sys .exit (2 )
847
+
849
848
# Copy from project directory to output directory if not done already.
850
849
if not os .path .exists (args .output_directory ):
851
850
shutil .copytree (args .project_directory , args .output_directory )
@@ -863,8 +862,8 @@ def main():
863
862
864
863
# Open YAML file with disable information.
865
864
if args .yaml_settings != "" :
866
- with openf (args .yaml_settings , "r" ) as lines :
867
- yaml_data = yaml .load (lines )
865
+ with openf (args .yaml_settings , "r" ) as f :
866
+ yaml_data = yaml .load (f )
868
867
869
868
# Disable functions in certain files according to YAML description
870
869
for disable_info in yaml_data ["disabled_functions" ]:
0 commit comments