blob: 976470b9093dbd8649bc44da599ff2525b8ca8db [file] [log] [blame]
Jamie Madill8a57b462017-12-28 12:25:03 -05001#!/usr/bin/python2
2#
3# Copyright 2017 The ANGLE Project Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6#
7# remove_file_if_exists.py:
8# This special action is needed to remove generated headers.
9# Otherwise ANGLE will pick up the old file(s) and the build will fail.
10#
11
12import sys
13import os
14
15if len(sys.argv) < 3:
16 print("Usage: " + sys.argv[0] + " <remove_file> <stamp_file>")
17
18remove_file = sys.argv[1]
19if os.path.isfile(remove_file):
20 os.remove(remove_file)
21
22# touch a dummy file to keep a timestamp
23with open(sys.argv[2], "w") as f:
24 f.write("blah")
25 f.close()