changelog/build.sh

21 lines
489 B
Bash
Raw Normal View History

2020-05-17 23:10:22 +00:00
#!/bin/bash
PLUGINS=$( grep -hv "^#!" plugins-enabled/* )
BUILD_FILE=build/changelog
mkdir -p build
[[ -f $BUILD_FILE ]] && rm $BUILD_FILE
cp changelog.sh $BUILD_FILE
PLUGIN_LINE=$(awk '/%PLUGIN%/ { print NR; exit}' $BUILD_FILE )
sed -i "${PLUGIN_LINE}r /dev/stdin" $BUILD_FILE <<< "$PLUGINS"
[[ -f config.sh ]] && {
CONFIG_LINE=$(awk '/%CONFIG%/ { print NR; exit}' $BUILD_FILE )
sed -i "${CONFIG_LINE}r config.sh" $BUILD_FILE
}
echo "Successfuly built $BUILD_FILE."