aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn/highest_version_dir.py
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-12-11 14:59:03 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-11 20:26:08 +0000
commit5c548924123227f1a3d1c03a2ff936161a06d631 (patch)
treeb12cc095ec0c6219ecda9b3764985915d2781b8d /gn/highest_version_dir.py
parentdba0bc843aac109106caf9dbe6a1a9f8c47f6ad1 (diff)
Filter Windows SDK and Compiler directories
This avoids bugs when other directories (like the Driver SDK) show up in those folders. Bug: skia:7395 Change-Id: Iee316a7daf8d71223b999de736d63e1dc7fa31f7 Reviewed-on: https://skia-review.googlesource.com/83542 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'gn/highest_version_dir.py')
-rw-r--r--gn/highest_version_dir.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gn/highest_version_dir.py b/gn/highest_version_dir.py
index 650154e4f3..1b82697d9a 100644
--- a/gn/highest_version_dir.py
+++ b/gn/highest_version_dir.py
@@ -6,8 +6,10 @@
# found in the LICENSE file.
import os
+import re
import sys
-dirpath, = sys.argv[1:]
+dirpath = sys.argv[1]
+regex = re.compile(sys.argv[2])
-print sorted(os.listdir(dirpath))[-1]
+print sorted(filter(regex.match, os.listdir(dirpath)))[-1]