Skip to content

Instantly share code, notes, and snippets.

@luginbash
Created May 12, 2014 05:42
Show Gist options
  • Save luginbash/eab939aae92238fea48e to your computer and use it in GitHub Desktop.
Save luginbash/eab939aae92238fea48e to your computer and use it in GitHub Desktop.
FSL doesn't support zsh by default, so I patched it for installation.
@@ -1066,6 +1066,7 @@ class FslInstall(object):
shells['ksh'] = '.profile'
shells['csh'] = '.cshrc'
shells['tcsh'] = '.cshrc'
+ shells['zsh'] = '.zshrc'
shellmap = {}
shellmap['bash'] = 'sh'
@@ -1073,6 +1074,7 @@ class FslInstall(object):
shellmap['tcsh'] = 'csh'
shellmap['sh'] = 'sh'
shellmap['csh'] = 'csh'
+ shellmap['zsh'] = 'zsh'
@egorananyev
Copy link

Thanks so much for this code! I didn't realise it would be so easy to make it compatible with zsh. They should really implement this as part of the installer code.

@fepegar
Copy link

fepegar commented Mar 26, 2017

Didn't work for me:

➜  ~ python Downloads/fslinstaller.py
--- FSL Installer - Version 2.0.21 ---
[Warning] Some operations of the installer require administative rights, for example installing into the default folder of /usr/local. If your account is an 'Administrator' (you have 'sudo' rights) then you will be prompted for your administrator password when necessary.
[OK] Installer is current
Where would you like to install FSL? [/usr/local]: /Users/fernando/FSL
Downloading FSL version 5.0.9 (this may take some time)
Checking download...        
[OK] Download is good.
Installing FSL software...
[OK] FSL software installed.
Creating Application links...
Password:
Checking for X11 windowing system (required for FSL GUIs).
[OK] X11 software (required for FSL GUIs) is installed.
Setting up FSL software...
[FAILED] Failed to update your profile zsh with FSL settings
➜  ~ 

@mistdon
Copy link

mistdon commented Apr 18, 2017

Same error: Failed to update your profile zsh with FSL settings
Mac version: macOS Sierra 10.12.3

@fepegar
Copy link

fepegar commented Aug 2, 2017

This worked for me. Modify fslinstaller.py as follows and then run it:

  1. In def shell_config(), add zsh to the conditions
  2. In def get_profile(), add these lines after declaring the homevariable:
if shell == 'zsh':
    profile = os.path.join(home, '.zshrc')
    return profile

Let me know if that worked for you!

@caglorithm
Copy link

Thanks fepegar, this easy fix worked well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment