aboutsummaryrefslogtreecommitdiff
path: root/util/docker_build.sh
diff options
context:
space:
mode:
authorKonstantin Đorđević <vomindoraan@gmail.com>2019-09-07 10:17:54 +0200
committerfauxpark <fauxpark@gmail.com>2019-09-07 18:17:54 +1000
commit4d339b7b5d1ecc2320080798d7e07e2d43675578 (patch)
treeb7b5755c507f671ff069e8ed31d0f0a614ad705a /util/docker_build.sh
parent736bdc7e97ec8f91a3bf36a6ae72d9b6729ab721 (diff)
downloadqmk_firmware-4d339b7b5d1ecc2320080798d7e07e2d43675578.tar.gz
qmk_firmware-4d339b7b5d1ecc2320080798d7e07e2d43675578.zip
Update docker_build.sh: indentation fix, error echo function (#6659)
* Replace spaces with tab in docker_build.sh * Use errcho instead of echo >&2
Diffstat (limited to 'util/docker_build.sh')
-rwxr-xr-xutil/docker_build.sh20
1 files changed, 12 insertions, 8 deletions
diff --git a/util/docker_build.sh b/util/docker_build.sh
index f36d5bcde..99d59d169 100755
--- a/util/docker_build.sh
+++ b/util/docker_build.sh
@@ -1,6 +1,10 @@
1#!/bin/sh 1#!/bin/sh
2# NOTE: This script uses tabs for indentation 2# NOTE: This script uses tabs for indentation
3 3
4errcho() {
5 echo "$@" >&2
6}
7
4USAGE="Usage: $0 [keyboard[:keymap[:target]]]" 8USAGE="Usage: $0 [keyboard[:keymap[:target]]]"
5 9
6# Check preconditions 10# Check preconditions
@@ -11,11 +15,11 @@ for arg; do
11 fi 15 fi
12done 16done
13if [ $# -gt 1 ]; then 17if [ $# -gt 1 ]; then
14 echo "$USAGE" >&2 18 errcho "$USAGE"
15 exit 1 19 exit 1
16elif ! command -v docker >/dev/null 2>&1; then 20elif ! command -v docker >/dev/null 2>&1; then
17 echo "Error: docker not found" >&2 21 errcho "Error: docker not found"
18 echo "See https://docs.docker.com/install/#supported-platforms for installation instructions" >&2 22 errcho "See https://docs.docker.com/install/#supported-platforms for installation instructions"
19 exit 2 23 exit 2
20fi 24fi
21 25
@@ -29,7 +33,7 @@ else
29 $1 33 $1
30 EOF 34 EOF
31 if [ -n "$x" ]; then 35 if [ -n "$x" ]; then
32 echo "$USAGE" >&2 36 errcho "$USAGE"
33 exit 1 37 exit 1
34 fi 38 fi
35fi 39fi
@@ -37,9 +41,9 @@ if [ -n "$target" ]; then
37 if [ "$(uname)" = "Linux" ] || docker-machine active >/dev/null 2>&1; then 41 if [ "$(uname)" = "Linux" ] || docker-machine active >/dev/null 2>&1; then
38 usb_args="--privileged -v /dev:/dev" 42 usb_args="--privileged -v /dev:/dev"
39 else 43 else
40 echo "Error: target requires docker-machine to work on your platform" >&2 44 errcho "Error: target requires docker-machine to work on your platform"
41 echo "See http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos" >&2 45 errcho "See http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos"
42 echo "Consider flashing with QMK Toolbox (https://github.com/qmk/qmk_toolbox) instead" >&2 46 errcho "Consider flashing with QMK Toolbox (https://github.com/qmk/qmk_toolbox) instead"
43 exit 3 47 exit 3
44 fi 48 fi
45fi 49fi
@@ -47,7 +51,7 @@ dir=$(pwd -W 2>/dev/null) || dir=$PWD # Use Windows path if on Windows
47 51
48# Run container and build firmware 52# Run container and build firmware
49docker run --rm -it $usb_args \ 53docker run --rm -it $usb_args \
50 -w /qmk_firmware/ \ 54 -w /qmk_firmware \
51 -v "$dir":/qmk_firmware \ 55 -v "$dir":/qmk_firmware \
52 -e ALT_GET_KEYBOARDS=true \ 56 -e ALT_GET_KEYBOARDS=true \
53 -e SKIP_GIT="$SKIP_GIT" \ 57 -e SKIP_GIT="$SKIP_GIT" \