Last active
May 14, 2021 18:34
-
-
Save johrstrom/c444b97b7afe092300a151b67515a998 to your computer and use it in GitHub Desktop.
Minimal bashrc to use at OSC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .bashrc | |
function source_if_exists() { | |
if [ -f $1 ]; then | |
. $1 | |
fi | |
} | |
function load_modules(){ | |
modules=( 'git' 'project/classes' "ruby/$RUBY_VERSION") | |
module purge 2>/dev/null | |
module restore 2>/dev/null | |
for mod in ${modules[@]} | |
do | |
module load $mod 2>/dev/null | |
done | |
} | |
source_if_exists /etc/bashrc | |
source_if_exists /opt/rh/rh-ruby27/enable | |
source_if_exists /opt/rh/rh-nodejs12/enable | |
source_if_exists /opt/rh/rh-git29/enable | |
source_if_exists $HOME/.local/etc/lmods | |
source_if_exists $HOME/.Renviron | |
export RUBY_VERSION="2.7.1" | |
load_modules | |
export GEM_HOME="$HOME/.gem/ruby" | |
export PATH="$HOME/bin:$PATH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment