From 5ff7a65e7f793957c23f6bdcbefae60e44fa3e07 Mon Sep 17 00:00:00 2001 From: Matt Keeler Date: Tue, 26 Jun 2018 11:46:37 -0400 Subject: [PATCH] Added capability to make dev-tree without pushing No push is the default --- GNUmakefile | 9 ++++++++- build-support/scripts/dev.sh | 18 +++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 1a89de1620..5ef2deeb88 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -94,6 +94,13 @@ export GIT_DESCRIBE export GOTAGS export GOLDFLAGS +DEV_PUSH?=0 +ifeq ($(DEV_PUSH),1) +DEV_PUSH_ARG= +else +DEV_PUSH_ARG=--no-push +endif + # all builds binaries for all targets all: bin @@ -129,7 +136,7 @@ publish: @$(SHELL) $(CURDIR)/build-support/scripts/publish.sh $(PUB_GIT_ARG) $(PUB_WEBSITE_ARG) dev-tree: - @$(SHELL) $(CURDIR)/build-support/scripts/dev.sh + @$(SHELL) $(CURDIR)/build-support/scripts/dev.sh $(DEV_PUSH_ARG) cov: gocov test $(GOFILES) | gocov-html > /tmp/coverage.html diff --git a/build-support/scripts/dev.sh b/build-support/scripts/dev.sh index 222002d993..12a2e88492 100755 --- a/build-support/scripts/dev.sh +++ b/build-support/scripts/dev.sh @@ -43,6 +43,7 @@ function main { declare build_os="" declare build_arch="" declare -i do_git=1 + declare -i do_push=1 while test $# -gt 0 @@ -72,6 +73,10 @@ function main { do_git=0 shift ;; + --no-push ) + do_push=0 + shift + ;; * ) err_usage "ERROR: Unknown argument: '$1'" return 1 @@ -86,11 +91,14 @@ function main { status_stage "==> Commiting Dev Mode Changes" commit_dev_mode "${sdir}" || return 1 - status_stage "==> Confirming Git Changes" - confirm_git_push_changes "${sdir}" || return 1 - - status_stage "==> Pushing to Git" - git_push_ref "${sdir}" || return 1 + if is_set "${do_push}" + then + status_stage "==> Confirming Git Changes" + confirm_git_push_changes "${sdir}" || return 1 + + status_stage "==> Pushing to Git" + git_push_ref "${sdir}" || return 1 + fi fi return 0