xref: /aosp_15_r20/external/skia/gn/highest_version_dir.py (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1#!/usr/bin/env python
2#
3# Copyright 2017 Google Inc.
4#
5# Use of this source code is governed by a BSD-style license that can be
6# found in the LICENSE file.
7
8from __future__ import print_function
9
10import os
11import re
12import sys
13
14dirpath = sys.argv[1]
15regex = re.compile(sys.argv[2])
16
17print(sorted(filter(regex.match, os.listdir(dirpath)))[-1])
18