[GRASS-SVN] r56175 - grass/trunk/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Thu May 9 06:05:02 PDT 2013


Author: martinl
Date: 2013-05-09 06:05:01 -0700 (Thu, 09 May 2013)
New Revision: 56175

Modified:
   grass/trunk/lib/init/grass.py
Log:
grass.py: improve check_shell() for Windows

Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2013-05-09 12:53:27 UTC (rev 56174)
+++ grass/trunk/lib/init/grass.py	2013-05-09 13:05:01 UTC (rev 56175)
@@ -769,6 +769,9 @@
         os.environ['OSTYPE'] = "cygwin"
     else:
         sh = os.path.basename(os.getenv('SHELL'))
+        if windows and sh:
+            sh = os.path.splitext(sh)[0]
+        
         if sh == "ksh":
             shellname = "Korn Shell"
         elif sh == "csh":
@@ -781,18 +784,18 @@
             shellname = "Bourne Shell"
         elif sh == "zsh":
             shellname = "Z Shell"
-        elif sh == "cmd.exe":
+        elif sh == "cmd":
             shellname = "Command Shell"
         else:
             shellname = "shell"
     
     if sh in ['csh', 'tcsh']:
         grass_env_file = os.path.join(grass_config_dir, 'cshrc')
-    elif sh in ['bash', 'msh', 'cygwin']:
+    elif sh in ['bash', 'msh', 'cygwin', 'sh']:
         grass_env_file = os.path.join(grass_config_dir, 'bashrc')
     elif sh == 'zsh':
         grass_env_file = os.path.join(grass_config_dir, 'zshrc')
-    elif sh == 'cmd.exe':
+    elif sh == 'cmd':
         grass_env_file = os.path.join(grass_config_dir, 'env.bat')
     else:
         grass_env_file = os.path.join(grass_config_dir, 'bashrc')



More information about the grass-commit mailing list