commit | 2daf66740bba0b2726462a547910d16cf0822db2 | [log] [tgz] |
---|---|---|
author | Matthew Buckett <matthew.buckett@oucs.ox.ac.uk> | Sat Jul 11 09:43:47 2009 -0400 |
committer | Shawn O. Pearce <sop@google.com> | Thu May 27 18:05:26 2010 -0700 |
tree | 45139dbc584bdbe297eaea71e6ff71822eaab751 | |
parent | f4f04d9fa8fda995974c9214eee42c3ea68b1125 [diff] [blame] |
Allow files to be copied into new folders Change-Id: I7f169e32be5a4328bb87ce7c2ff4b6529e925126
diff --git a/project.py b/project.py index ff896d0..1bcd959 100644 --- a/project.py +++ b/project.py
@@ -203,6 +203,10 @@ # remove existing file first, since it might be read-only if os.path.exists(dest): os.remove(dest) + else: + dir = os.path.dirname(dest) + if not os.path.isdir(dir): + os.makedirs(dir) shutil.copy(src, dest) # make the file read-only mode = os.stat(dest)[stat.ST_MODE]