openwrt-bgme-feed/.prepare.sh
bgme de7e69dbe3 Squashed 'luci-app-einat/' content from commit 82838e7
git-subtree-dir: luci-app-einat
git-subtree-split: 82838e76d43b3b947c4bd5ddac26d5be02d5fb94
2025-04-21 13:54:00 +08:00

20 lines
653 B
Bash
Executable file

PKG_NAME="$1"
CURDIR="$2"
PKG_BUILD_DIR="$3"
if [ -d "$CURDIR/.git" ]; then
config="$CURDIR/.git/config"
else
config="$(sed "s|^gitdir:\s*|$CURDIR/|;s|$|/config|" "$CURDIR/.git")"
fi
[ -n "$(sed -En '/^\[remote /{h;:top;n;/^\[/b;s,(https?://gitcode\.(com|net)),\1,;T top;H;x;s|\n\s*|: |;p;}' "$config")" ] && {
for d in luasrc ucode htdocs root src; do
rm -rf "$PKG_BUILD_DIR"/$d
done
mkdir -p "$PKG_BUILD_DIR"/htdocs/luci-static/resources/view
touch "$PKG_BUILD_DIR"/htdocs/luci-static/resources/view/$PKG_NAME.js
mkdir -p "$PKG_BUILD_DIR"/root/usr/share/luci/menu.d
touch "$PKG_BUILD_DIR"/root/usr/share/luci/menu.d/$PKG_NAME.json
}
exit 0