Go builder for single file functions (#492)

Add support to go builder for building a single file (otherwise even a single file needs to be archived in a .zip)
This commit is contained in:
Soam Vasani
2018-02-08 18:55:49 -08:00
committed by GitHub
parent a5cb1d3e3d
commit d9b5c2e560
+17 -2
View File
@@ -1,4 +1,19 @@
#!/bin/sh
cd ${SRC_PKG}
go build -buildmode=plugin -i -o ${DEPLOY_PKG} .
if [ -d ${SRC_PKG} ]
then
echo "Building in directory ${SRC_PKG}"
cd ${SRC_PKG}
go build -buildmode=plugin -i -o ${DEPLOY_PKG} .
elif [ -f ${SRC_PKG} ]
then
fn=$(basename ${SRC_PKG})
d=/tmp/$fn
mkdir $d
trap "rm -rf /tmp/$fn" EXIT
echo "Building file ${SRC_PKG} in $d"
cd $d
cp ${SRC_PKG} ./function.go
go build -buildmode=plugin -i -o ${DEPLOY_PKG} .
fi