This is an automated email from the ASF dual-hosted git repository. nferraro pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/master by this push: new e628434 fix: Add .exe file extension to Windows kamel binary e628434 is described below commit e628434c0f4bb80e801348f85545f2797df05108 Author: James Netherton <jamesnether...@gmail.com> AuthorDate: Thu Apr 25 10:35:28 2019 +0100 fix: Add .exe file extension to Windows kamel binary fixes #619 --- script/cross_compile.sh | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/script/cross_compile.sh b/script/cross_compile.sh index 88e857d..2256c99 100755 --- a/script/cross_compile.sh +++ b/script/cross_compile.sh @@ -1,9 +1,9 @@ -#!/bin/sh +#!/bin/bash location=$(dirname $0) -builddir=$(realpath $location/../xtmp) +builddir=$(realpath ${location}/../xtmp) -rm -rf $builddir +rm -rf ${builddir} basename=camel-k-client @@ -15,22 +15,27 @@ fi version=$1 cross_compile () { - label=$1 + local label=$1 + local extension="" export GOOS=$2 export GOARCH=$3 - targetdir=$builddir/$label - go build -o $targetdir/kamel ./cmd/kamel/... + if [ "${GOOS}" == "windows" ]; then + extension=".exe" + fi - cp $location/../LICENSE $targetdir/ - cp $location/../NOTICE $targetdir/ + targetdir=${builddir}/${label} + go build -o ${targetdir}/kamel${extension} ./cmd/kamel/... - pushd . && cd $targetdir && tar -zcvf ../../$label.tar.gz . && popd + cp ${location}/../LICENSE ${targetdir}/ + cp ${location}/../NOTICE ${targetdir}/ + + pushd . && cd ${targetdir} && tar -zcvf ../../${label}.tar.gz . && popd } -cross_compile $basename-$version-linux-64bit linux amd64 -cross_compile $basename-$version-mac-64bit darwin amd64 -cross_compile $basename-$version-windows-64bit windows amd64 +cross_compile ${basename}-${version}-linux-64bit linux amd64 +cross_compile ${basename}-${version}-mac-64bit darwin amd64 +cross_compile ${basename}-${version}-windows-64bit windows amd64 -rm -rf $builddir +rm -rf ${builddir}