From 7ece458cd90cbaf872323779aaf8bc82b8b43ec5 Mon Sep 17 00:00:00 2001 From: zeldaroot Date: Sat, 13 Jun 2020 01:28:24 +0300 Subject: [PATCH] Added autochange theme --- cinemapress.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cinemapress.sh b/cinemapress.sh index 1b348b5..c44012e 100644 --- a/cinemapress.sh +++ b/cinemapress.sh @@ -2111,7 +2111,14 @@ docker_cinematheme() { rm -rf /var/theme && mkdir -p /var/theme cd /var/theme && cinematheme "${@}" sleep 3 + cd /var/theme/ && for i in */; do + if [ "${i%%/}" != "" ]; then + sed -Ei "s/\"theme\":\s*\"[a-zA-Z0-9-]*\"/\"theme\":\"${i%%/}\"/" \ + /home/"${CP_DOMAIN}"/config/production/config.js + fi + done cp -rf /var/theme/* /home/"${CP_DOMAIN}"/themes/ + cd /home/"${CP_DOMAIN}" && pm2 delete process.json && pm2 start process.json sleep 3 rm -rf /var/theme } @@ -3092,7 +3099,9 @@ while [ "${WHILE}" -lt "2" ]; do "temp"|"template"|"design"|"cinematheme"|"ct" ) read_domain "${2}" sh_not - docker exec -it "${CP_DOMAIN_}" /usr/bin/cinemapress container cinematheme "${@}" + if [ "${3}" != "" ]; then + docker exec -it "${CP_DOMAIN_}" /usr/bin/cinemapress container cinematheme "${@}" + fi exit 0 ;; "cms" )