aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/target-present
blob: 530117c15b23351dd8b3463a22ab6a9a9fe8931e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python3
#
# SPDX-License-Identifier: GPL-2.0-only
#
# Check whether a target exists in config.json
#

import json
import os
import sys

import utils

parser = utils.ArgParser(description='Runs configurations in json.conf.')

parser.add_argument('target',
                    help="The 'nightly' target the autobuilder is running")

args = parser.parse_args()

scriptsdir = os.path.dirname(os.path.realpath(__file__))
os.environ["SCRIPTSDIR"] = scriptsdir
ourconfig = utils.loadconfig()

# Find out if this target exists
if args.target in ourconfig['overrides']:
    sys.exit(0)
sys.exit(1)