1#!/usr/bin/env python 2# 3# Copyright 2020 Google LLC. 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 subprocess 14import os 15 16 17URL = "https://github.com/vektra/mockery/releases/download/v2.4.0/mockery_2.4.0_Linux_x86_64.tar.gz" 18 19 20def create_asset(target_dir): 21 """Create the asset.""" 22 os.chdir(target_dir) 23 output = subprocess.check_output(["wget", URL, "--output-document=mockery.tar.gz"]) 24 print(output) 25 output = subprocess.check_output(["tar", "-xvf", "mockery.tar.gz"]) 26 print(output) 27 os.remove("mockery.tar.gz") 28 29 30def main(): 31 parser = argparse.ArgumentParser() 32 parser.add_argument('--target_dir', '-t', required=True) 33 args = parser.parse_args() 34 create_asset(args.target_dir) 35 36 37if __name__ == '__main__': 38 main() 39