Files
angle/scripts/file_exists.py
Geoff Lang d7d42395ac Format all of ANGLE's python code.
BUG=angleproject:3421

Change-Id: I1d7282ac513c046de5d8ed87f7789290780d30a6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1595440
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2019-05-06 18:56:09 +00:00

27 lines
573 B
Python

#!/usr/bin/python2
# Copyright 2019 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Simple helper for use in 'gn' files to check if a file exists.
from __future__ import print_function
import os, shutil, sys
def main():
if len(sys.argv) != 2:
print("Usage: %s <path>" % sys.argv[0])
sys.exit(1)
if os.path.exists(sys.argv[1]):
print("true")
else:
print("false")
sys.exit(0)
if __name__ == '__main__':
main()