From 4dbd612d474317fdd7bd983f2d1a05654c2ceaad Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 13 Jan 2016 14:53:49 -0800 Subject: [PATCH] Windows: In container build check Signed-off-by: John Howard --- hack/make.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/hack/make.sh b/hack/make.sh index 78f25cdcbc..2206a21a5b 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -29,11 +29,22 @@ export MAKEDIR="$SCRIPTDIR/make" # We're a nice, sexy, little shell script, and people might try to run us; # but really, they shouldn't. We want to be in a container! -if [ "$PWD" != "/go/src/$DOCKER_PKG" ] || [ -z "$DOCKER_CROSSPLATFORMS" ]; then +inContainer="AssumeSoInitially" +if [ "$(go env GOHOSTOS)" = 'windows' ]; then + if [ -n "$FROM_DOCKERFILE" ]; then + unset inContainer + fi +else + if [ "$PWD" != "/go/src/$DOCKER_PKG" ] || [ -z "$DOCKER_CROSSPLATFORMS" ]; then + unset inContainer + fi +fi + +if [ -n "$inContainer" ]; then { - echo "# WARNING! I don't seem to be running in the Docker container." + echo "# WARNING! I don't seem to be running in a Docker container." echo "# The result of this command might be an incorrect build, and will not be" - echo "# officially supported." + echo "# officially supported." echo "#" echo "# Try this instead: make all" echo "#"