• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python
2#
3# Copyright 2019 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 common  # pylint: disable=unused-import
14import os
15import subprocess
16import utils
17
18
19# Remember to also update the go asset when this is updated.
20GO_URL = "https://dl.google.com/go/go1.13.5.windows-amd64.zip"
21
22
23def create_asset(target_dir):
24  """Create the asset."""
25  with utils.tmp_dir():
26    cwd = os.getcwd()
27    zipfile = os.path.join(cwd, 'go.zip')
28    subprocess.check_call(["wget", '-O', zipfile, GO_URL])
29    subprocess.check_call(["unzip", zipfile, "-d", target_dir])
30
31
32def main():
33  parser = argparse.ArgumentParser()
34  parser.add_argument('--target_dir', '-t', required=True)
35  args = parser.parse_args()
36  create_asset(args.target_dir)
37
38
39if __name__ == '__main__':
40  main()
41