From e76b37973bf15ba1b3fdefbb74731430fda12d44 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 15 Aug 2014 18:29:56 -0400 Subject: use(): Drop directory cases --- (limited to 'src') 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 -- cgit v0.9.1