Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/angle
Path: blob/main_old/scripts/remove_files.py
1693 views
1
#!/usr/bin/python2
2
#
3
# Copyright 2019 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_files.py:
8
# This special action is used to cleanup old files from the build directory.
9
# Otherwise ANGLE will pick up the old file(s), causing build or runtime errors.
10
#
11
12
import glob
13
import os
14
import sys
15
16
if len(sys.argv) < 3:
17
print("Usage: " + sys.argv[0] + " <stamp_file> <remove_patterns>")
18
19
stamp_file = sys.argv[1]
20
21
for i in range(2, len(sys.argv)):
22
remove_pattern = sys.argv[i]
23
remove_files = glob.glob(remove_pattern)
24
for f in remove_files:
25
if os.path.isfile(f):
26
os.remove(f)
27
28
# touch an unused file to keep a timestamp
29
with open(stamp_file, "w") as f:
30
f.write("blah")
31
f.close()
32
33