optionally rebuild plugins.

This commit is contained in:
Miroslav Šedivý 2022-05-08 00:32:20 +02:00
parent 0e6b411988
commit 91c8f0886b

23
build
View File

@ -1,12 +1,16 @@
#!/bin/bash
mkdir -p bin/plugins
rm bin/plugins/* 2>/dev/null
#
# aborting if any command returns a non-zero value
set -e
#
# do not build plugins when passing "core" as first argument
if [ "$1" = "core" ];
then
skip_plugins="true"
fi
#
# set git build variables if git exists
if git version > /dev/null && [ -z $GIT_COMMIT ] && [ -z $GIT_COMMIT ];
@ -31,6 +35,14 @@ go build \
" \
cmd/neko/main.go;
#
# if plugins are ignored
if [ "$skip_plugins" = "true" ];
then
echo "Not building plugins..."
exit 0
fi
#
# if plugins directory does not exist
if [ ! -d "./plugins" ];
@ -39,6 +51,11 @@ then
exit 0
fi
#
# ensure plugins folder exits and remove old plugins
mkdir -p bin/plugins
rm -f bin/plugins/*
#
# build plugins
for plugPath in ./plugins/*; do