mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-07 16:00:28 +03:00
init: prompt user for Android SDK path using platform-specific default
This commit is contained in:
parent
1d4e3a254d
commit
535f2afe90
1 changed files with 13 additions and 3 deletions
|
|
@ -100,11 +100,21 @@ def main():
|
||||||
# make sure at least aapt is found, since this can't do anything without it
|
# make sure at least aapt is found, since this can't do anything without it
|
||||||
test_config['aapt'] = common.find_sdk_tools_cmd('aapt')
|
test_config['aapt'] = common.find_sdk_tools_cmd('aapt')
|
||||||
else:
|
else:
|
||||||
# if neither --android-home nor the default sdk_path exist, prompt the user
|
# if neither --android-home nor the default sdk_path
|
||||||
|
# exist, prompt the user using platform-specific default
|
||||||
default_sdk_path = '/opt/android-sdk'
|
default_sdk_path = '/opt/android-sdk'
|
||||||
if sys.platform == 'win32' or sys.platform == 'cygwin':
|
if sys.platform == 'win32' or sys.platform == 'cygwin':
|
||||||
default_sdk_path = os.path.join(os.getenv('USERPROFILE'),
|
p = os.path.join(os.getenv('USERPROFILE'),
|
||||||
'AppData', 'Local', 'Android', 'android-sdk')
|
'AppData', 'Local', 'Android', 'android-sdk')
|
||||||
|
elif sys.platform == 'darwin':
|
||||||
|
# on OSX, Homebrew is common and has an easy path to detect
|
||||||
|
p = '/usr/local/opt/android-sdk'
|
||||||
|
else:
|
||||||
|
# if the Debian packages are installed, suggest them
|
||||||
|
p = '/usr/lib/android-sdk'
|
||||||
|
if os.path.exists(p):
|
||||||
|
default_sdk_path = p
|
||||||
|
|
||||||
while not options.no_prompt:
|
while not options.no_prompt:
|
||||||
try:
|
try:
|
||||||
s = input(_('Enter the path to the Android SDK (%s) here:\n> ') % default_sdk_path)
|
s = input(_('Enter the path to the Android SDK (%s) here:\n> ') % default_sdk_path)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue