2 local -r APP_NAME
="nwn"
3 local -r TMPDIR
="${TMPDIR:-/tmp}"
4 local RW_BRANCH
="${RW_BRANCH:-${XDG_DATA_HOME}/${APP_NAME}}"
5 local -r APP_DIR
="${TMPDIR}/${APP_NAME}-tmp-${USER}"
6 local -r CONF_DIR
="/etc/${APP_NAME}"
7 local -r BRANCHES_D
="/etc/${APP_NAME}/branches.d"
10 if [ ! -d "${RW_BRANCH}" ]; then
14 mkdir
-p "${RW_BRANCH}" "${APP_DIR}" &&
15 { findmnt
"${APP_DIR}" || RW_BRANCH="${RW_BRANCH}" modfs -o cow -o "uid=${UID}" -o "gid=${GROUPS[0]}" "${BRANCHES_D}" "${APP_DIR}"; } &&
20 fusermount -u "${APP_DIR}" &&
25 local -r EXEC_NAME=$(basename "${1}")
26 local -r EXEC_D="${CONF_DIR}/hooks.d
"
27 local -r EXEC_PREFIX="nwn.hooks.
${EXEC_NAME}.
"
28 if [ -d "${EXEC_D}" ]; then
30 for f in "${EXEC_D}/"*.sh; do
31 [ -f "${f}" ] && source "${f}"
34 local -a commandLine=($(compgen -A function "${EXEC_PREFIX}") "${@}")