9"""Create the asset and upload it."""
18FILE_DIR = os.path.dirname(os.path.abspath(__file__))
19ASSET = os.path.basename(FILE_DIR)
23 sk = os.path.realpath(os.path.join(
24 FILE_DIR, os.pardir, os.pardir, os.pardir, os.pardir,
'bin',
'sk'))
27 if not os.path.isfile(sk):
28 raise Exception(
'`sk` not found at %s; maybe you need to run bin/fetch-sk?')
32 tmp_prefix = os.path.join(FILE_DIR,
'.')
33 with tempfile.TemporaryDirectory(prefix=tmp_prefix)
as tmp:
34 subprocess.check_call([sk,
'asset',
'download', ASSET, tmp], cwd=FILE_DIR)
36 input(
'Previous SKImage contents have been downloaded. Please make '
37 'your desired changes in the following directory and press enter '
38 'to continue:\n%s\n' % tmp)
39 subprocess.check_call([sk,
'asset',
'upload',
'--in', tmp, ASSET],
43if __name__ ==
'__main__':