#!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.


"""Create the asset and upload it."""


import argparse
import os
import subprocess
import sys
import tempfile
import create


FILE_DIR = os.path.dirname(os.path.abspath(__file__))
ASSET = os.path.basename(FILE_DIR)


def main():
  if 'linux' not in sys.platform:
    print('This script only runs on Linux.', file=sys.stderr)
    sys.exit(1)
  parser = argparse.ArgumentParser()
  parser.add_argument('--lib_path', '-l', required=True)
  args = parser.parse_args()
  # Pass lib_path to the creation script via an environment variable, since
  # we're calling the script via `sk` and not directly.
  os.environ[create.ENV_VAR] = args.lib_path

  sk = os.path.realpath(os.path.join(
      FILE_DIR, os.pardir, os.pardir, os.pardir, os.pardir, 'bin', 'sk'))
  if os.name == 'nt':
    sk += '.exe'
  if not os.path.isfile(sk):
    raise Exception('`sk` not found at %s; maybe you need to run bin/fetch-sk?')

  # Upload the asset.
  subprocess.check_call([sk, 'asset', 'upload', ASSET], cwd=FILE_DIR)


if __name__ == '__main__':
  main()

37ae27f0657103c7f678c1982099f5eff187da41
<mask token>


def main():
    if 'linux' not in sys.platform:
        print('This script only runs on Linux.', file=sys.stderr)
        sys.exit(1)
    parser = argparse.ArgumentParser()
    parser.add_argument('--lib_path', '-l', required=True)
    args = parser.parse_args()
    os.environ[create.ENV_VAR] = args.lib_path
    sk = os.path.realpath(os.path.join(FILE_DIR, os.pardir, os.pardir, os.
        pardir, os.pardir, 'bin', 'sk'))
    if os.name == 'nt':
        sk += '.exe'
    if not os.path.isfile(sk):
        raise Exception(
            '`sk` not found at %s; maybe you need to run bin/fetch-sk?')
    subprocess.check_call([sk, 'asset', 'upload', ASSET], cwd=FILE_DIR)


<mask token>

<mask token>


def main():
    if 'linux' not in sys.platform:
        print('This script only runs on Linux.', file=sys.stderr)
        sys.exit(1)
    parser = argparse.ArgumentParser()
    parser.add_argument('--lib_path', '-l', required=True)
    args = parser.parse_args()
    os.environ[create.ENV_VAR] = args.lib_path
    sk = os.path.realpath(os.path.join(FILE_DIR, os.pardir, os.pardir, os.
        pardir, os.pardir, 'bin', 'sk'))
    if os.name == 'nt':
        sk += '.exe'
    if not os.path.isfile(sk):
        raise Exception(
            '`sk` not found at %s; maybe you need to run bin/fetch-sk?')
    subprocess.check_call([sk, 'asset', 'upload', ASSET], cwd=FILE_DIR)


if __name__ == '__main__':
    main()

<mask token>
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
ASSET = os.path.basename(FILE_DIR)


def main():
    if 'linux' not in sys.platform:
        print('This script only runs on Linux.', file=sys.stderr)
        sys.exit(1)
    parser = argparse.ArgumentParser()
    parser.add_argument('--lib_path', '-l', required=True)
    args = parser.parse_args()
    os.environ[create.ENV_VAR] = args.lib_path
    sk = os.path.realpath(os.path.join(FILE_DIR, os.pardir, os.pardir, os.
        pardir, os.pardir, 'bin', 'sk'))
    if os.name == 'nt':
        sk += '.exe'
    if not os.path.isfile(sk):
        raise Exception(
            '`sk` not found at %s; maybe you need to run bin/fetch-sk?')
    subprocess.check_call([sk, 'asset', 'upload', ASSET], cwd=FILE_DIR)


if __name__ == '__main__':
    main()

<mask token>
import argparse
import os
import subprocess
import sys
import tempfile
import create
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
ASSET = os.path.basename(FILE_DIR)


def main():
    if 'linux' not in sys.platform:
        print('This script only runs on Linux.', file=sys.stderr)
        sys.exit(1)
    parser = argparse.ArgumentParser()
    parser.add_argument('--lib_path', '-l', required=True)
    args = parser.parse_args()
    os.environ[create.ENV_VAR] = args.lib_path
    sk = os.path.realpath(os.path.join(FILE_DIR, os.pardir, os.pardir, os.
        pardir, os.pardir, 'bin', 'sk'))
    if os.name == 'nt':
        sk += '.exe'
    if not os.path.isfile(sk):
        raise Exception(
            '`sk` not found at %s; maybe you need to run bin/fetch-sk?')
    subprocess.check_call([sk, 'asset', 'upload', ASSET], cwd=FILE_DIR)


if __name__ == '__main__':
    main()

#!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.


"""Create the asset and upload it."""


import argparse
import os
import subprocess
import sys
import tempfile
import create


FILE_DIR = os.path.dirname(os.path.abspath(__file__))
ASSET = os.path.basename(FILE_DIR)


def main():
  if 'linux' not in sys.platform:
    print('This script only runs on Linux.', file=sys.stderr)
    sys.exit(1)
  parser = argparse.ArgumentParser()
  parser.add_argument('--lib_path', '-l', required=True)
  args = parser.parse_args()
  # Pass lib_path to the creation script via an environment variable, since
  # we're calling the script via `sk` and not directly.
  os.environ[create.ENV_VAR] = args.lib_path

  sk = os.path.realpath(os.path.join(
      FILE_DIR, os.pardir, os.pardir, os.pardir, os.pardir, 'bin', 'sk'))
  if os.name == 'nt':
    sk += '.exe'
  if not os.path.isfile(sk):
    raise Exception('`sk` not found at %s; maybe you need to run bin/fetch-sk?')

  # Upload the asset.
  subprocess.check_call([sk, 'asset', 'upload', ASSET], cwd=FILE_DIR)


if __name__ == '__main__':
  main()
