26 lines
868 B
Bash
Executable File
26 lines
868 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
PLUGIN="u-navigator"
|
|
VERSION="2026.06.23.r040"
|
|
PKG_DIR="packages"
|
|
WORK_DIR=".plugin-build"
|
|
PKG_NAME="${PLUGIN}-${VERSION}.tgz"
|
|
|
|
rm -rf "$WORK_DIR"
|
|
mkdir -p "$WORK_DIR/usr/local/emhttp/plugins/${PLUGIN}/assets" "$PKG_DIR"
|
|
|
|
cp -R plugin-root/usr "$WORK_DIR/"
|
|
cp server/public/app.js "$WORK_DIR/usr/local/emhttp/plugins/${PLUGIN}/assets/app.js"
|
|
cp server/public/styles.css "$WORK_DIR/usr/local/emhttp/plugins/${PLUGIN}/assets/styles.css"
|
|
perl -0pi -e "s/__VERSION__/${VERSION}/g" "$WORK_DIR/usr/local/emhttp/plugins/${PLUGIN}/U-Navigator.page"
|
|
|
|
tar -czf "$PKG_DIR/$PKG_NAME" -C "$WORK_DIR" usr
|
|
rm -rf "$WORK_DIR"
|
|
|
|
MD5="$(md5 -q "$PKG_DIR/$PKG_NAME" 2>/dev/null || md5sum "$PKG_DIR/$PKG_NAME" | awk '{print $1}')"
|
|
sed "s/__VERSION__/${VERSION}/g; s/__MD5__/${MD5}/g" u-navigator.plg.in > u-navigator.plg
|
|
|
|
echo "Built $PKG_DIR/$PKG_NAME"
|
|
echo "MD5 $MD5"
|