[enh] There should be a build script

This commit is contained in:
alban 2020-05-18 01:10:22 +02:00
parent d296e615e9
commit dddd30aa96

20
build.sh Executable file
View File

@ -0,0 +1,20 @@
#!/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."