def CopyTool(source_path):
"""Copies the given tool to the current directory, including a warning not
to edit it."""
with open(source_path) as source_file:
tool_source = source_file.readlines()
# Add header and write it out to the current directory (which should be the
# root build dir).
out_path = 'gyp-mac-tool'
with open(out_path, 'w') as tool_file:
tool_file.write(''.join([tool_source[0],
'# Generated by setup_toolchain.py do not edit.\n']
+ tool_source[1:]))
st = os.stat(out_path)
os.chmod(out_path, st.st_mode | stat.S_IEXEC)
# Find the tool source, it's the first argument, and copy it.
评论列表
文章目录