1 #!/usr/bin/env python 2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. 3 # Use of this source code is governed by a BSD-style license that can be 4 # found in the LICENSE file. 5 6 import os 7 import sys 8 9 hooks_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) 10 if hooks_path not in sys.path: 11 sys.path.append(hooks_path) 12 13 from hooks import install 14 from tracing.build import tracing_dev_server 15 16 if __name__ == '__main__': 17 dev_server_args = sys.argv[1:] 18 # This parses sys.argv instead of using argparse because 19 # tracing_dev_server.Main also uses argparse, and using argparse here would 20 # override its help message. 21 if '--no-install-hooks' not in sys.argv: 22 install.InstallHooks() 23 else: 24 dev_server_args.remove('--no-install-hooks') 25 sys.exit(tracing_dev_server.Main(dev_server_args)) 26