Skip to content

Commit

Permalink
Merge pull request #24 from scipion-em/csh
Browse files Browse the repository at this point in the history
fix csh installation with conda
  • Loading branch information
pconesa committed Nov 3, 2020
2 parents 62cafef + a9a8d15 commit d7cf7dd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGES.txt
@@ -1,3 +1,3 @@

1.0.10 - fix csh/tcsh installations
19-December-2019 - First version of the scipion installer

2 changes: 1 addition & 1 deletion scipioninstaller/__init__.py
@@ -1,2 +1,2 @@
INSTALL_ENTRY = 'installscipion'
__version__ = '1.0.9'
__version__ = '1.0.10'
11 changes: 9 additions & 2 deletions scipioninstaller/installer.py
Expand Up @@ -62,11 +62,18 @@ def getCondaCmd(scipionEnv, noAsk):

def getCondaInitCmd():
shell = os.path.basename(os.environ.get("SHELL", "bash"))
return 'eval "$(%s shell.%s hook)"' % (checkProgram(CONDA), shell)
if shell in ["csh", "tcsh"]:
return 'set cinit="`%s shell.%s hook`" && eval "$cinit"' % (checkProgram(CONDA), shell)
else:
return 'eval "$(%s shell.%s hook)"' % (checkProgram(CONDA), shell)


def getCondaenvActivationCmd(scipionEnv):
return "conda activate %s" % scipionEnv
shell = os.path.basename(os.environ.get("SHELL", "bash"))
if shell in ["csh", "tcsh"]:
return 'set cact="`%s shell.%s activate %s`" && eval "$cact"' % (checkProgram(CONDA), shell, scipionEnv)
else:
return "conda activate %s" % scipionEnv


def cmdfy(cmd, sep=CMD_SEP):
Expand Down

0 comments on commit d7cf7dd

Please sign in to comment.