Procházet zdrojové kódy

g.extension: add warning when GRASS_ADDON_PATH is not defined

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@46760 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa před 14 roky
rodič
revize
b7472756d3
1 změnil soubory, kde provedl 5 přidání a 0 odebrání
  1. 5 0
      scripts/g.extension/g.extension.py

+ 5 - 0
scripts/g.extension/g.extension.py

@@ -368,6 +368,11 @@ def install_extension():
     else:
         grass.message(_("Installation of '%s' successfully finished.") % options['extension'])
 
+    if not os.environ.has_key('GRASS_ADDON_PATH') or \
+            not os.environ['GRASS_ADDON_PATH']:
+        grass.warning(_('This add-on module will not function until you set the '
+                        'GRASS_ADDON_PATH environment variable (see "g.manual variables")'))
+
 def remove_extension():
     # is module available?
     if not os.path.exists(os.path.join(options['prefix'], 'bin', options['extension'])):