#!/usr/bin/env fish
set -gx LMOD_ROOT /usr/share/lmod
set -gx LMOD_PKG  /usr/share/lmod/lmod
set -gx LMOD_DIR  /usr/share/lmod/lmod/libexec
set -gx LMOD_CMD  /usr/share/lmod/lmod/libexec/lmod

set -gx MODULESHOME /usr/share/lmod/lmod

set -gx LMOD_VERSION "9.0.4"

set -gx FPATH (/usr/share/lmod/lmod/libexec/addto --append FPATH /usr/share/lmod/lmod/init/ksh_funcs)

if status -i
   function module
      eval $LMOD_CMD fish $argv | source -
   end
else
   function module
      eval $LMOD_CMD fish --no_redirect $argv | source -
   end
end

function ml
   eval $LMOD_DIR/ml_cmd $argv | source -
end
