blob: 1b82697d9afa195a81593031c06f6754a484bd70 [file] [log] [blame]
Brian Osmand34c4a32017-12-06 13:26:38 -05001#!/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
8import os
Brian Osman5c548922017-12-11 14:59:03 -05009import re
Brian Osmand34c4a32017-12-06 13:26:38 -050010import sys
11
Brian Osman5c548922017-12-11 14:59:03 -050012dirpath = sys.argv[1]
13regex = re.compile(sys.argv[2])
Brian Osmand34c4a32017-12-06 13:26:38 -050014
Brian Osman5c548922017-12-11 14:59:03 -050015print sorted(filter(regex.match, os.listdir(dirpath)))[-1]