mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-23 08:17:56 +02:00
41 lines
964 B
Bash
41 lines
964 B
Bash
#!/bin/bash
|
|
|
|
if [[ -z ${sbindir} ]]; then
|
|
local sbindir=$(dirname "${BASH_SOURCE}")
|
|
sbindir=$(cd "${sbindir}"/.. && pwd)"/sbin"
|
|
fi
|
|
|
|
pmodules::get_options() {
|
|
local "$1"
|
|
std::upvar $1 $("${sbindir}/getopt" "${@:2}")
|
|
}
|
|
|
|
pmodules::check_env_vars() {
|
|
[[ -n "${PMODULES_ROOT}" ]] &&
|
|
[[ -n "${PMODULES_HOME}" ]] &&
|
|
[[ -n "${PMODULES_VERSION}" ]] || std::die 1 "
|
|
Error: the module environment you are going to use as source has not been
|
|
initialized properly!"
|
|
}
|
|
|
|
pmodules::check_directories() {
|
|
local -r src_prefix="$1"
|
|
|
|
[[ -d "${src_prefix}" ]] &&
|
|
[[ -d "${src_prefix}/${PMODULES_CONFIG_DIR}" ]] &&
|
|
[[ -d "${src_prefix}/Tools/Pmodules/${PMODULES_VERSION}" ]] || std::die 1 "
|
|
Error: the module environment '${src_prefix}' has not been initialized properly!"
|
|
}
|
|
|
|
pmodules::check_env() {
|
|
pmodules::check_env_vars
|
|
pmodules::check_directories "${PMODULES_ROOT}"
|
|
}
|
|
|
|
|
|
# Local Variables:
|
|
# mode: sh
|
|
# sh-basic-offset: 8
|
|
# tab-width: 8
|
|
# End:
|