updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / ascendancy-non-us / libascendancy.sh
blob30bb5336f7f912b03ec1b0bc09a7643b3b1b67c1
1 ascendancy.run() {
2 local APP_NAME="ascendancy"
3 local TMPDIR="${TMPDIR:-/tmp}"
4 local RW_BRANCH="${XDG_DATA_HOME}/${APP_NAME}"
5 local APP_DIR="${TMPDIR}/${APP_NAME}-tmp-${USER}"
6 local BRANCHES_D="/etc/${APP_NAME}.d"
7 local DOSBOX_CONF="${XDG_CONFIG_HOME}/${APP_NAME}/$(basename $(dosbox -printconf))"
8 local __firstRun=false
10 if [ ! -f "${DOSBOX_CONF}" ]; then
11 install -Dm644 $(dosbox -printconf) "${DOSBOX_CONF}"
14 if [ ! -d "${RW_BRANCH}" ]; then
15 __firstRun=true
18 mkdir -p "${RW_BRANCH}" "${APP_DIR}" &&
19 RW_BRANCH="${RW_BRANCH}" modfs -o cow -o "uid=${UID}" -o "gid=${GROUPS[0]}" "${BRANCHES_D}" "${APP_DIR}" &&
20 cd "${APP_DIR}" &&
21 "$@"
23 cd / &&
24 fusermount -u "${APP_DIR}" &&
25 rmdir "${APP_DIR}"
28 ascendancy.firstRun() {
29 "${__firstRun}"