Files
modules/init/fish.in
Xavier Delaruelle ff1db855ba install: add --with-fishcompletiondir configure opt
Add the --with-fishcompletiondir option to the configure installation
script to define a particular installation directory for the fish
completion script.

If option is not defined, fish completion script is installed by default
in initdir and it is sourced in fish init script. If option is set,
completion script is installed in designated directory and fish init
script does not source it.
2021-11-24 08:51:03 +01:00

58 lines
2.3 KiB
Plaintext

# define modules runtine quarantine configuration
@setquarvars@set -xg MODULES_RUN_QUARANTINE '@RUN_QUARANTINE@'
@setquarvars@@set -xg RUNENV_VAR 'RUNENV_VAL'@
@notsetquarvars@#set -xg MODULES_RUN_QUARANTINE 'ENVVARNAME'
@notsetquarvars@
# setup quarantine if defined
set _mlre '';
for _mlv in (string split ' ' $MODULES_RUN_QUARANTINE)
if string match -r '^[A-Za-z_][A-Za-z0-9_]*$' $_mlv >/dev/null
if set -q $_mlv
set _mlre $_mlre"__MODULES_QUAR_"$_mlv"='$$_mlv' "
end
set _mlrv "MODULES_RUNENV_$_mlv"
set _mlre "$_mlre$_mlv='$$_mlrv' "
end
end
if [ -n "$_mlre" ]
set _mlre "env $_mlre __MODULES_QUARANTINE_SET=1"
end
# define module command and surrounding initial environment (default value
# for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files)
eval $_mlre @TCLSH@ @libexecdir@/modulecmd.tcl fish autoinit | source -
# no environment alteration if the above autoinit command failed
if [ $status -eq 0 ]
@sourcefishcomp@ if status -i
@sourcefishcomp@ if [ -r @initdir@/fish_completion ]
@sourcefishcomp@ source @initdir@/fish_completion
@sourcefishcomp@ end
@sourcefishcomp@ end
@sourcefishcomp@
@setbinpath@ if not contains @bindir@ $PATH
@setbinpath@@prependbinpath@ set -xg PATH @bindir@ $PATH
@setbinpath@@appendbinpath@ set -xg PATH $PATH @bindir@
@setbinpath@ end
@setbinpath@
@setmanpath@ # initialize MANPATH if not set with a value that preserves manpath system
@setmanpath@ # configuration even after addition of paths to this variable by modulefiles
@setmanpath@ if not set -q MANPATH
@setmanpath@ set -xg MANPATH :
@setmanpath@ end
@setmanpath@@usemanpath@ if not string match -q '*:@mandir@:*' :(manpath 2>/dev/null):
@setmanpath@@notusemanpath@ if not string match -q '*:@mandir@:*' :$MANPATH:
@setmanpath@ if [ -z "$MANPATH" -o "$MANPATH" = ':' ]
@setmanpath@ set _mlpathsep ''
@setmanpath@ else
@setmanpath@ set _mlpathsep :
@setmanpath@ end
@setmanpath@@prependmanpath@ set -xg MANPATH @mandir@$_mlpathsep$MANPATH
@setmanpath@@appendmanpath@ set -xg MANPATH $MANPATH$_mlpathsep@mandir@
@setmanpath@ set -e _mlpathsep
@setmanpath@ end
end
# clean temp variables used to setup quarantine
set -e _mlre; set -e _mlv; set -e _mlrv;