mirror of
https://github.com/YunoHost-Apps/movim_ynh.git
synced 2024-09-03 19:46:19 +02:00
35 lines
748 B
Bash
35 lines
748 B
Bash
#
|
|
# Common variables
|
|
#
|
|
|
|
# Git repository of Movim
|
|
GIT_REPO="https://github.com/movim/movim"
|
|
|
|
# Commit to checkout
|
|
HEAD_COMMIT="00ef035b92ae78cce34521deee7a12634444878d"
|
|
|
|
# Source code destination directory
|
|
DESTDIR="/var/www/movim"
|
|
|
|
# App package root directory should be the parent folder
|
|
PKGDIR=$(cd ../; pwd)
|
|
|
|
#
|
|
# Common helpers
|
|
#
|
|
|
|
# Execute a command as movim user in the destination directory
|
|
# usage: exec_cmd COMMAND [ARG ...]
|
|
exec_cmd() {
|
|
(cd "$DESTDIR" \
|
|
&& sudo sudo -u movim "$@")
|
|
}
|
|
|
|
# Apply the SSO patch to Movim source code
|
|
# usage: apply_sso_patch
|
|
apply_sso_patch() {
|
|
local patch_path="/tmp/sso-logout.patch"
|
|
cp -f "${PKGDIR}/patches/sso-logout.patch" "$patch_path"
|
|
exec_cmd git apply "$patch_path"
|
|
rm -f "$patch_path"
|
|
}
|