diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-08-15 18:29:56 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-08-15 18:32:57 (EDT) |
commit | e76b37973bf15ba1b3fdefbb74731430fda12d44 (patch) | |
tree | 36df2f87317acd4b2ffba3c7657ea0ed00f6a687 | |
parent | f0f580aba27a0adc9efc853d75885265a7dbf788 (diff) |
use(): Drop directory cases
-rw-r--r-- | src/prokit.sh | 25 |
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 |