os.makedirs, unlike 'mkdir -p', errors if the target directory already
exists [1,2].
[1]: http://docs.python.org/2/library/os.html#os.makedirs
"Raises an error exception if the leaf directory already exists
or cannot be created"
[2]: http://docs.python.org/3/library/os.html#os.makedirs
"If exist_ok is False (the default), an OSError is raised if the
target directory already exists."
' sys.exit(nose.core.main())',
'',
])
+ if not os.path.isdir(python_scripts_directory):
+ os.makedirs(python_scripts_directory)
with open(os.path.join(python_scripts_directory, 'nosetests'), 'w') as f:
f.write(contents)