blob: c278b2afa48f3c5fa22cf7522803f32795d92292 [file] [log] [blame]
Frank Henigman7824b602015-11-16 19:45:10 -05001# Copyright 2015 Google Inc. 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.
4
5"""Generate .gclient file for Angle.
6
7Because gclient won't accept "--name ." use a different name then edit.
8"""
9
10import subprocess
11import sys
12
13
14def main():
15 gclient_cmd = [
16 'gclient', 'config',
17 '--name', 'change2dot',
18 '--unmanaged',
19 'https://chromium.googlesource.com/angle/angle.git'
20 ]
21 cmd_str = ' '.join(gclient_cmd)
22 try:
23 rc = subprocess.call(gclient_cmd)
24 except OSError:
25 print 'could not run "%s" - is gclient installed?' % cmd_str
26 sys.exit(1)
27
28 if rc:
29 print 'failed command: "%s"' % cmd_str
30 sys.exit(1)
31
32 with open('.gclient') as gclient_file:
33 content = gclient_file.read()
34
35 with open('.gclient', 'w') as gclient_file:
36 gclient_file.write(content.replace('change2dot', '.'))
37
38 print 'created .gclient'
39
40if __name__ == '__main__':
41 main()