1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
9 def CopyTool(source_path
):
10 """Copies the given tool to the current directory, including a warning not
12 with
open(source_path
) as source_file
:
13 tool_source
= source_file
.readlines()
15 # Add header and write it out to the current directory (which should be the
17 out_path
= 'gyp-mac-tool'
18 with
open(out_path
, 'w') as tool_file
:
19 tool_file
.write(''.join([tool_source
[0],
20 '# Generated by setup_toolchain.py do not edit.\n']
22 st
= os
.stat(out_path
)
23 os
.chmod(out_path
, st
.st_mode | stat
.S_IEXEC
)
25 # Find the tool source, it's the first argument, and copy it.
26 if len(sys
.argv
) != 2:
27 print "Need one argument (mac_tool source path)."