zshlibs/global.funcs.zsh

57 lines
1.1 KiB
Bash
Raw Normal View History

2021-12-20 14:08:22 +00:00
typeset -g globaldots_path="${HOME}/.global"
if [[ -a $(realpath -m $(dirname $0)/../../.globaldir ) ]]
then
typeset -g globaldots_path=$(realpath -m $(dirname $0)/../../)
fi
if [[ -n ${GLOBALDOTS_PATH} ]]
then
typeset -g globaldots_path=${GLOBALDOTS_PATH}
fi
2021-11-10 14:41:19 +00:00
if [[ -z $globaldots_path ]]; then
echo 'functions require $globaldots_path to be set!'
fi
2022-01-11 16:41:36 +00:00
# ZCONFIG
2022-01-11 15:01:21 +00:00
2022-01-11 16:41:36 +00:00
## stuff for global dotfiles
2021-12-20 14:08:22 +00:00
2021-11-10 14:41:19 +00:00
function global_path_expand()
{
local bin_base=${globaldots_path}/bin
for pathnew in ${*}; do
2022-01-11 15:20:34 +00:00
zshlibs_path_add "${bin_base}/${pathnew}"
2021-11-10 14:41:19 +00:00
done;
}
function global_fpath_expand()
{
local bin_base=${globaldots_path}/bin
for pathnew in ${*}; do
2022-01-11 15:20:34 +00:00
zshlibs_fpath_add "${bin_base}/${pathnew}"
2021-11-10 14:41:19 +00:00
done;
}
2022-01-11 16:41:36 +00:00
function global_set_useropts()
2021-11-10 14:41:19 +00:00
{
2022-01-11 16:41:36 +00:00
typeset -a -g path_extra
2021-11-10 14:41:19 +00:00
}
2022-01-11 16:41:36 +00:00
function global_configure()
2021-11-10 14:41:19 +00:00
{
}
2022-01-11 16:41:36 +00:00
function global_config_setup()
2021-11-10 14:41:19 +00:00
{
2022-01-11 16:41:36 +00:00
zshlibs_log global "expanding path with '$path_extra'"
2021-11-10 14:41:19 +00:00
global_path_expand $path_extra
2022-01-11 16:41:36 +00:00
zshlibs_log global "expanding fpath with '$fpath_extra'"
2021-11-10 14:41:19 +00:00
global_fpath_expand vanilla
2022-01-11 16:41:36 +00:00
zshlibs_log global "done loading noninteractive config"
2021-11-10 14:41:19 +00:00
}
2022-01-11 16:41:36 +00:00
## normal functions