Skip to content

Commit

Permalink
g.extension: fix -i (compile), -d (download) flag (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmszi committed Apr 9, 2020
1 parent c08180d commit b937d7d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scripts/g.extension/g.extension.py
Expand Up @@ -684,7 +684,7 @@ def install_extension(source, url, xmlurl):
if len(mlist) > 1:
print('-' * 60)

if flags['d']:
if flags['d'] or flags['i']:
return

if ret != 0:
Expand Down Expand Up @@ -1349,7 +1349,7 @@ def install_extension_std_platforms(name, source, url):
sys.stderr.write(' '.join(make_cmd) + '\n')
grass.message("\n%s\n" % _("To install run:"))
sys.stderr.write(' '.join(install_cmd) + '\n')
return 0
return 0, None, None

os.chdir(os.path.join(TMPDIR, name))

Expand All @@ -1364,7 +1364,7 @@ def install_extension_std_platforms(name, source, url):
' Please check above error messages.'))

if flags['i']:
return 0
return 0, None, None

grass.message(_("Installing..."))

Expand Down Expand Up @@ -1940,10 +1940,12 @@ def main():
list_installed_extensions(toolboxes=flags['t'])
return 0

if flags['d']:
if flags['d'] or flags['i']:
flag = 'd' if flags['d'] else 'i'
if options['operation'] != 'add':
grass.warning(_("Flag 'd' is relevant only to"
" 'operation=add'. Ignoring this flag."))
grass.warning(_("Flag '{}' is relevant only to"
" 'operation=add'. Ignoring this flag.").format(
flag))
else:
global REMOVE_TMPDIR
REMOVE_TMPDIR = False
Expand Down

0 comments on commit b937d7d

Please sign in to comment.