Skip to content

Commit 902be52

Browse files
committed
allow the init script to specify the base_dir
1 parent 86ed037 commit 902be52

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

init.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22

33
import os
4+
import sys
45
import subprocess
56

67
import requests
@@ -14,7 +15,8 @@
1415
# Script arguments.
1516

1617
base_url = f'https://github.com/{github_user}/{github_repo}/releases/latest/download'
17-
base_dir = os.path.join(os.getcwd(), 'packages', package_name)
18+
base_dir = os.path.join(os.getcwd(), 'packages', package_name) \
19+
if len(sys.argv) < 2 else os.path.normpath(sys.argv[1])
1820
android_base = os.path.join(base_dir, 'android', 'src', 'main', 'jniLibs')
1921
ios_base = os.path.join(base_dir, 'ios')
2022
target_files: list = [
@@ -74,7 +76,7 @@ def download(url: str, dest: str, filename: str):
7476
print()
7577

7678
for (url, dest, filename, msg) in target_files:
77-
print(f'Starting to download {filename} [{msg}]')
79+
print(f'Starting to download {filename} [{msg}]\nDestination: {dest}')
7880
download(url, dest, filename)
7981

8082
print('Finished downloading files.')

0 commit comments

Comments
 (0)