Problem
I have removed the default initial_storage directory in my WebDAV plugin, as it is "empty" (I do not deliver my plugin with the default foo.txt provided by metwork in this directory, it seems obvious to me) and I have no initial file(s) to write on the WebDAV.
But without this (useless) initial_storage directory into the plugin, the WebDAV directory (by default ~/var/storage/<plugin>/) is not created, that's annoying...
Solution
In adm/_plugins.postinstall, replace:
if test "${USE_STORAGE}" = "1"; then
mkdir -p "${MFBASE_NGINX_STORAGE_DIR}"
if test -d "${PLUGIN_HOME}/initial_storage"; then
rm -Rf "${MFBASE_NGINX_STORAGE_DIR:?}/${NAME}"
cp -Rf "${PLUGIN_HOME}/initial_storage" "${MFBASE_NGINX_STORAGE_DIR}/${NAME}"
fi
fi
by something like this:
if test "${USE_STORAGE}" = "1"; then
mkdir -p "${MFBASE_NGINX_STORAGE_DIR}/${NAME}"
if test -d "${PLUGIN_HOME}/initial_storage"; then
cp -Rf "${PLUGIN_HOME}/initial_storage/*" "${MFBASE_NGINX_STORAGE_DIR}/${NAME}/"
fi
fi
So the plugin's storage dir is created if not exists (we keep existing one in case it exists) and we copy files from initial_storage (if exists) in it.