Commit 7291750a authored by Edward Lesmes's avatar Edward Lesmes Committed by LUCI CQ

presubmit: Add dirmd_bin to CheckDirMetadataFormat.

dirmd is not available on bots, so we'll need to receive the path
where it's available as an argument.

Bug: 1102997
Change-Id: I8966225d8ded3eb06c504797280baaa6c6c64a9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2321510Reviewed-by: 's avatarNodir Turakulov <nodir@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent a58287b8
......@@ -1028,7 +1028,7 @@ def CheckBuildbotPendingBuilds(input_api, output_api, url, max_pendings,
return []
def CheckDirMetadataFormat(input_api, output_api):
def CheckDirMetadataFormat(input_api, output_api, dirmd_bin=None):
# TODO(crbug.com/1102997): Remove OWNERS once DIR_METADATA migration is
# complete.
file_filter = lambda f: (
......@@ -1042,13 +1042,12 @@ def CheckDirMetadataFormat(input_api, output_api):
return []
name = 'Validate metadata in OWNERS and DIR_METADATA files'
dirmd_bin = 'dirmd.bat' if input_api.is_windows else 'dirmd'
kwargs = {}
if input_api.is_windows:
# Needed to be able to resolve 'dirmd.bat'.
kwargs['shell'] = True
if dirmd_bin is None:
dirmd_bin = 'dirmd.bat' if input_api.is_windows else 'dirmd'
cmd = [dirmd_bin, 'validate'] + sorted(affected_files)
return [input_api.Command(
name, cmd, kwargs, output_api.PresubmitError)]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment