• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python
2#
3# Copyright 2018 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
8
9"""Create the asset."""
10
11
12import argparse
13import os
14import subprocess
15import sys
16
17FILE_DIR = os.path.dirname(os.path.abspath(__file__))
18INFRA_BOTS_DIR = os.path.realpath(os.path.join(FILE_DIR, os.pardir, os.pardir))
19sys.path.insert(0, INFRA_BOTS_DIR)
20import utils
21
22
23# Download URL can be found on this page:
24# https://docs.microsoft.com/en-us/sysinternals/downloads/procdump
25PROCDUMP_URL = 'https://download.sysinternals.com/files/Procdump.zip'
26
27
28def create_asset(target_dir):
29  """Create the asset."""
30  with utils.tmp_dir():
31    subprocess.check_call(["curl", PROCDUMP_URL, "-o", "procdump.zip"])
32    subprocess.check_call(["unzip", "procdump.zip", "-d", target_dir])
33
34
35def main():
36  parser = argparse.ArgumentParser()
37  parser.add_argument('--target_dir', '-t', required=True)
38  args = parser.parse_args()
39  create_asset(args.target_dir)
40
41
42if __name__ == '__main__':
43  main()
44