diff --git a/bin/.gitkeep b/bin/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/bin/compile-plugins.sh b/bin/compile-plugins.sh new file mode 100644 index 0000000..278bc7c --- /dev/null +++ b/bin/compile-plugins.sh @@ -0,0 +1,26 @@ +#!/usr/bin bash + + +function compile_default_plugins() { + makeshift_exe=./makeshift + go_exe=go + + # make sure go build tools are installed + if command -v $go_exe >/dev/null 2>&1; then + # make sure that MAKESHIFT_ROOT is set + if [[ ! -v MAKESHIFT_ROOT ]]; then + # Compile the default external plugins + go build + $makeshift_exe compile pkg/plugins/jinja2/jinja2.go -o $MAKESHIFT_ROOT/plugins/jinja2.go + $makeshift_exe compile pkg/plugins/smd/smd.go -o $MAKESHIFT_ROOT/plugins/smd.so + $makeshift_exe compile pkg/plugins/userdata/userdata.go -o $MAKESHIFT_ROOT/plugins/userdata.go + else + echo "requires MAKESHIFT_ROOT to be set" + fi + else + echo "Go build tools must be installed" + fi +} + + +compile_default_plugins \ No newline at end of file