8000 allow custom destination paths · pygame/python-for-android@975162e · GitHub
[go: up one dir, main page]

Skip to content

Commit 975162e

Browse files
author
Robert Pfeiffer
committed
allow custom destination paths
1 parent 9686a98 commit 975162e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ def make_package(args):
239239
assets_dir = "src/main/assets"
240240

241241
# Delete the old assets.
242-
ensure_dir(assets_dir)
243-
shutil.rmtree(assets_dir)
242+
if os.path.exists(assets_dir):
243+
shutil.rmtree(assets_dir)
244244
ensure_dir(assets_dir)
245245
open(os.path.join(assets_dir, ".gitkeep"), 'a').close()
246246

pythonforandroid/toolchain.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,11 @@ def add_parser(subparsers, *args, **kwargs):
589589
if hasattr(args, "assets") and args.assets is not None:
590590
# Pass this value on to the internal bootstrap build.py:
591591
for asset in args.assets:
592-
args.unknown_args += ["--asset", os.path.abspath(asset)+":"+asset]
592+
if ":" in asset:
593+
asset_src, asset_dest = asset.split(":")
594+
else:
595+
asset_src = asset_dest = asset
596+
args.unknown_args += ["--asset", os.path.abspath(asset_src)+":"+asset_dest]
593597
if hasattr(args, "ignore_setup_py") and args.ignore_setup_py:
594598
args.use_setup_py = False
595599

0 commit comments

Comments
 (0)
0