summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/prokit.sh25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/prokit.sh b/src/prokit.sh
index 28d3b65..af7ab44 100644
--- a/src/prokit.sh
+++ b/src/prokit.sh
@@ -36,30 +36,9 @@ OPTSTRING='hV'
use()
{
local module="${1}"
- local default_dir=
- local lib_subdir=
- local dir=
- if [ "x${module%/*}" = "x${module}" ]; then
- default_dir="${PKGDATADIR}"
- lib_subdir=''
- else
- case "${module%/*}" in
- 'cmd')
- default_dir="${PKGDATACMDDIR}"
- lib_subdir='cmd'
- ;;
- 'profiles')
- default_dir="${PKGDATAPROFILEDIR}"
- lib_subdir='profiles'
- ;;
- esac
- fi
-
- dir="${default_dir}"
-
- if [ -f "${dir}/${module##*/}.sm" ]; then
- . "${dir}/${module##*/}.sm"
+ if [ -f "${PKGDATADIR}/${module}.sm" ]; then
+ . "${PKGDATADIR}/${module}.sm"
else
printf '%s: Error: Failed to load module "%s": %s\n' \
"${0##*/}" "${module}" 'no such file or directory' >&2