mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Use realpath when comparing paths
This commit is contained in:
parent
fda996014b
commit
2e1d44dc23
|
@ -17,11 +17,19 @@ IGNORE_FILES = [
|
|||
"src/engine/client/keynames.h",
|
||||
"src/engine/keys.h",
|
||||
]
|
||||
IGNORE_DIRS = [
|
||||
"src/game/generated",
|
||||
"src/rust-bridge"
|
||||
]
|
||||
def filter_ignored(filenames):
|
||||
return [filename for filename in filenames
|
||||
if filename not in IGNORE_FILES
|
||||
and not filename.startswith("src/game/generated/")
|
||||
and not filename.startswith("src/rust-bridge")]
|
||||
result = []
|
||||
for filename in filenames:
|
||||
real_filename = os.path.realpath(filename)
|
||||
if real_filename not in [os.path.realpath(ignore_file) for ignore_file in IGNORE_FILES] \
|
||||
and not any(real_filename.startswith(os.path.realpath(subdir) + os.path.sep) for subdir in IGNORE_DIRS):
|
||||
result.append(filename)
|
||||
|
||||
return result
|
||||
|
||||
def filter_cpp(filenames):
|
||||
return [filename for filename in filenames
|
||||
|
|
Loading…
Reference in a new issue