scons: Ensure git_sha1.h's directory exists.
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
@@ -130,7 +130,9 @@ def write_git_sha1_h_file(filename):
|
|||||||
(commit, foo) = subprocess.Popen(args, stdout=subprocess.PIPE).communicate()
|
(commit, foo) = subprocess.Popen(args, stdout=subprocess.PIPE).communicate()
|
||||||
except:
|
except:
|
||||||
# git log command didn't work
|
# git log command didn't work
|
||||||
if not os.path.exists(filename):
|
dirname = os.path.dirname(filename)
|
||||||
|
if not os.path.exists(dirname):
|
||||||
|
os.makedirs(dirname)
|
||||||
# create an empty file if none already exists
|
# create an empty file if none already exists
|
||||||
f = open(filename, "w")
|
f = open(filename, "w")
|
||||||
f.close()
|
f.close()
|
||||||
|
Reference in New Issue
Block a user