Takuto Ikuta | 3dab32e0 | 2023-01-12 18:52:00 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Avi Drissman | 73a09d1 | 2022-09-08 20:33:38 | [diff] [blame] | 2 | # Copyright 2014 The Chromium Authors |
jochen@chromium.org | 1731cd4 | 2014-03-26 19:10:02 | [diff] [blame] | 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | """This program wraps an arbitrary command and prints "1" if the command ran |
| 7 | successfully.""" |
| 8 | |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 9 | |
jochen@chromium.org | 29c8539a | 2014-04-03 07:36:32 | [diff] [blame] | 10 | import os |
jochen@chromium.org | 1731cd4 | 2014-03-26 19:10:02 | [diff] [blame] | 11 | import subprocess |
| 12 | import sys |
| 13 | |
jochen@chromium.org | 29c8539a | 2014-04-03 07:36:32 | [diff] [blame] | 14 | devnull = open(os.devnull, 'wb') |
| 15 | if not subprocess.call(sys.argv[1:], stdout=devnull, stderr=devnull): |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 16 | print(1) |
jochen@chromium.org | 1731cd4 | 2014-03-26 19:10:02 | [diff] [blame] | 17 | else: |
Raul Tambre | 9e24293b | 2019-05-12 06:11:07 | [diff] [blame] | 18 | print(0) |