openwrt-bgme-feed/.prepare.sh
bgme 23fa869d86 Squashed 'einat-ebpf/' content from commit 3ca81b6
git-subtree-dir: einat-ebpf
git-subtree-split: 3ca81b661559606ef42023e2e9a9dd4b74a3ed18
2025-04-21 13:52:45 +08:00

14 lines
367 B
Bash
Executable file

VERSION="$1"
CURDIR="$2"
BIN_PATH="$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")" ] && {
echo -e "#!/bin/sh\necho $VERSION" > "$BIN_PATH"
}
exit 0