image-entry: improve NGX_HTTP_STATIC_MERGE behavior
This commit is contained in:
@@ -5,6 +5,9 @@ set -ef
|
|||||||
|
|
||||||
## hack: override "cache", "lib" and "log" from /angie (and possibly from /etc/angie)
|
## hack: override "cache", "lib" and "log" from /angie (and possibly from /etc/angie)
|
||||||
fake_dir=$(mktemp -d)
|
fake_dir=$(mktemp -d)
|
||||||
|
if [ "${NGX_HTTP_STATIC_MERGE}" = 0 ] ; then
|
||||||
|
persist_dirs="${persist_dirs} static"
|
||||||
|
fi
|
||||||
for n in ${persist_dirs} ; do touch "${fake_dir}/$n" ; done
|
for n in ${persist_dirs} ; do touch "${fake_dir}/$n" ; done
|
||||||
|
|
||||||
install -d "${target_root}"
|
install -d "${target_root}"
|
||||||
@@ -18,7 +21,6 @@ if [ "${NGX_HTTP_STATIC_MERGE}" = 0 ] ; then
|
|||||||
src0=/etc/angie.dist/static
|
src0=/etc/angie.dist/static
|
||||||
dst="${target_root}/static"
|
dst="${target_root}/static"
|
||||||
|
|
||||||
rm -rf "${dst}"
|
|
||||||
for r in /angie /etc/angie ; do
|
for r in /angie /etc/angie ; do
|
||||||
src="$r/static"
|
src="$r/static"
|
||||||
[ -d "${src}" ] || continue
|
[ -d "${src}" ] || continue
|
||||||
@@ -29,6 +31,7 @@ if [ "${NGX_HTTP_STATIC_MERGE}" = 0 ] ; then
|
|||||||
|
|
||||||
install -d "${dst}"
|
install -d "${dst}"
|
||||||
overlaydirs --merge "${dst}" ${src0} "${src}"
|
overlaydirs --merge "${dst}" ${src0} "${src}"
|
||||||
|
break
|
||||||
done
|
done
|
||||||
[ -d "${dst}" ] || {
|
[ -d "${dst}" ] || {
|
||||||
log_always "static directory is almost empty!"
|
log_always "static directory is almost empty!"
|
||||||
|
Reference in New Issue
Block a user