Add update-vendor.sh symlink support, unify install.sh vendor flow
- update-vendor.sh now creates webui/vendor symlinks (htm.js) - install.sh calls update-vendor.sh after package install - Add vendor/.empty and webui/vendor/.empty as directory placeholders in git
This commit is contained in:
@@ -5,6 +5,7 @@ set -euo pipefail
|
||||
|
||||
# ---- Library versions ----
|
||||
ACME_VERSION="3.1.3"
|
||||
HTM_VERSION="3.1.1"
|
||||
|
||||
VENDOR="vendor"
|
||||
|
||||
@@ -22,6 +23,32 @@ download "acme.sh@${ACME_VERSION}" \
|
||||
"https://raw.githubusercontent.com/acmesh-official/acme.sh/${ACME_VERSION}/acme.sh" \
|
||||
"${VENDOR}/acme.sh"
|
||||
|
||||
download "htm@${HTM_VERSION}" \
|
||||
"https://raw.githubusercontent.com/developit/htm/${HTM_VERSION}/mini/index.module.js" \
|
||||
"${VENDOR}/htm.js"
|
||||
|
||||
chmod +x "${VENDOR}/acme.sh"
|
||||
|
||||
# --- Symlinks for webui ---
|
||||
WEBUI_VENDOR="webui/static/vendor"
|
||||
mkdir -p "$WEBUI_VENDOR"
|
||||
|
||||
WEBUI_LINKS=(
|
||||
"htm.js:../../../vendor/htm.js"
|
||||
)
|
||||
|
||||
for entry in "${WEBUI_LINKS[@]}"; do
|
||||
IFS=':' read -r name target <<< "$entry"
|
||||
if [[ -L "${WEBUI_VENDOR}/${name}" ]]; then
|
||||
cur=$(readlink "${WEBUI_VENDOR}/${name}")
|
||||
if [[ "$cur" != "$target" ]]; then
|
||||
echo "[symlink] ${WEBUI_VENDOR}/${name} → ${target} (updated)"
|
||||
ln -sf "$target" "${WEBUI_VENDOR}/${name}"
|
||||
fi
|
||||
else
|
||||
echo "[symlink] ${WEBUI_VENDOR}/${name} → ${target}"
|
||||
ln -sf "$target" "${WEBUI_VENDOR}/${name}"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "[done] All libraries vendored."
|
||||
|
||||
Reference in New Issue
Block a user