Commit a31a68fa authored by Garrett Beaty's avatar Garrett Beaty Committed by Commit Bot

Remove unused conditionally_execute script.

Bug: 889992
Change-Id: I9a8d8f787507c7e461b8a02ad5b130389a9f876c
Reviewed-on: https://chromium-review.googlesource.com/c/1351489Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612303}
parent f6a98274
#!/usr/bin/env vpython
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import subprocess
import sys
def main(args):
parser = argparse.ArgumentParser()
parser.add_argument(
'--gyp-condition', '-c', type=str, required=True,
help=('The gyp condition that acts as the switch. If the '
'condition is found in environment variable GYP_DEFINES, '
'this will execute the target script'))
options, script_args = parser.parse_known_args()
# Make sure that we always execute target script with python.
if 'python' not in script_args[0]:
script_args.insert(0, sys.executable)
# A typical GYP_DEFINES string looks s.t like "foo=a bar=1 baz=c". We
# tokenize the string before doing string matching.
gyp_defines = os.environ.get('GYP_DEFINES', '').split()
if options.gyp_condition in gyp_defines:
subprocess.check_call(script_args)
return 0
if __name__ == '__main__':
main(sys.argv[1:])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment